analitics

Pages

Showing posts with label IDE. Show all posts
Showing posts with label IDE. Show all posts

Saturday, February 24, 2024

Python 3.12.1 : The kaitai python module and IDE online tool.

Kaitai Struct is a declarative language used to describe various binary data structures, laid out in files or in memory: i.e. binary file formats, network stream packet formats, etc.
The main idea is that a particular format is described in Kaitai Struct language (.ksy file) and then can be compiled with ksc into source files in one of the supported programming languages. These modules will include a generated code for a parser that can read the described data structure from a file or stream and give access to it in a nice, easy-to-comprehend API.
Let's install the Python module:
python3 -m pip install --upgrade kaitaistruct
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

C:\PythonProjects\kaitai_001>python -m pip install --upgrade kaitaistruct
Collecting kaitaistruct
  Downloading kaitaistruct-0.10-py2.py3-none-any.whl.metadata (2.5 kB)
Downloading kaitaistruct-0.10-py2.py3-none-any.whl (7.0 kB)
Installing collected packages: kaitaistruct
Successfully installed kaitaistruct-0.10
The Kaitai compiler can be downloaded from the official website.
After installation, you can use the compiler ...
kaitai-struct-compiler.bat --version
kaitai-struct-compiler 0.10
...
kaitai-struct-compiler.bat --help
kaitai-struct-compiler 0.10
Usage: kaitai-struct-compiler [options] ...

  ...                source files (.ksy)
  -t, --target   target languages (graphviz, csharp, rust, all, perl, java, go, cpp_stl, php, lua, python, nim, html, ruby, construct, javascript)
  -d, --outdir 
                           output directory (filenames will be auto-generated); on Unix-like shells, the short form `-d` requires arguments to be preceded by `--`
  -I, --import-path ;;...
                           .ksy library search path(s) for imports (see also KSPATH env variable)
  --cpp-namespace 
                           C++ namespace (C++ only, default: none)
  --cpp-standard 
                           C++ standard to target (C++ only, supported: 98, 11, default: 98)
  --go-package    Go package (Go only, default: none)
  --java-package 
                           Java package (Java only, default: root package)
  --java-from-file-class 
                           Java class to be invoked in fromFile() helper (default: io.kaitai.struct.ByteBufferKaitaiStream)
  --dotnet-namespace 
                           .NET Namespace (.NET only, default: Kaitai)
  --php-namespace 
                           PHP Namespace (PHP only, default: root package)
  --python-package 
                           Python package (Python only, default: root package)
  --nim-module     Path of Nim runtime module (Nim only, default: kaitai_struct_nim_runtime)
  --nim-opaque     Directory of opaque Nim modules (Nim only, default: directory of generated module)
  --opaque-types    opaque types allowed, default: false
  --ksc-exceptions         ksc throws exceptions instead of human-readable error messages
  --ksc-json-output        output compilation results as JSON to stdout
  --verbose         verbose output
  --no-auto-read           disable auto-running `_read` in constructor
  --read-pos               `_read` remembers attribute positions in stream
  --debug                  same as --no-auto-read --read-pos (useful for visualization tools)
  --help                   display this help and exit
  --version                output version information and exit
Steps to use this tool with Python. You need to use a defined kaitai file format for your file type - for example, gif file format, compile this kaitai then you can use it in this manner:
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
import mmap
print('kaitai version : ', ks_version)
f = open("python_giphy.gif", "rb")
with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as buf:
    stream = KaitaiStream(BytesIO(buf))
    obj1 = print(stream)
    obj2 = print(stream)
    obj3 = print(stream)
stream.close()
I only test a little but is a great tool.
Kaitai Struct is free and open-source software, licensed under the following terms: Compiler and visualizer — GPLv3+ and these Runtime libraries:
  • C++/STL — MIT
  • C# — MIT
  • Go — MIT
  • Java — MIT
  • JavaScript — Apache v2
  • Lua — MIT
  • Nim — MIT
  • Perl — MIT
  • PHP — MIT
  • Python — MIT
  • Ruby — MIT
  • Rust — MIT
  • Swift — MIT
    Is easier to understand if you use the IDE on the web. On the left side you can see a cloud icon for upload, first, select the kaitai GIF type from formats/image/gif.ksy from web IDE, then select a GIF file from your computer and upload.
    The default IDE looks like this:

    Saturday, November 4, 2023

    News : NINJA-IDE version 2.4

    The NINJA-IDE is a cross-platform integrated development environment (IDE). NINJA-IDE runs on Linux/X11, Mac OS X and Windows desktop operating systems, and allows developers to create applications for several purposes using all the tools and utilities of NINJA-IDE, making the task of writing software easier and more enjoyable.
    You can download it from the offical website.
    I did not find any significant changes compared to the previous version.

    Friday, July 26, 2019

    Python 3.7.3 : Tonny I.D.E. for python programmers.

    Today I tested the Thonny I.D.E. from thonny.org official webpage.
    Yesterday I tried several editors for python programming language and did not work.
    One of these is the spyder editor that does not work with python 3.7.3 - we have not discovered why.
    The Mu is a simple Python editor for beginner programmers and has a strange working I.D.E. for good and fast development.
    The PyCharm, it is developed by the Czech company JetBrains is not fully free ...

    The Thonny I.D.E. is fast and comes with two good features:
    Code completion and Highlights syntax errors.
    The install steps are easy with a wizard application.
    After that, you can test with any python source code.
    The source code from the image is a simple example from this webpage.
    Let's see a screenshot:

    This is a video tutorial with this I.D.E. from Aivar Annamaa user:



    Wednesday, April 3, 2019

    About Ninja IDE for python programming.

    This I.D.E. is a very good tool for python programming and development.
    The version of this tool is 2.3.
    I tested with my Django project on Windows OS and works great.
    The development team comes with this info:
    NINJA-IDE (from the recursive acronym: "Ninja-IDE Is Not Just Another IDE"), is a cross-platform integrated development environment (IDE). NINJA-IDE runs on Linux/X11, Mac OS X and Windows desktop operating systems, and allows developers to create applications for several purposes using all the tools and utilities of NINJA-IDE, making the task of writing software easier and more enjoyable.
    The official webpage can be found here.
    If you want to use it with Django the easy way is to install the plugin for this area.
    You can see all about the development team about page.

    Saturday, March 3, 2018

    News: The Spyder IDE - new release .

    Many python users use the Spyder IDE.
    This IDE comes with many features and is easy to use, see Wikipedia page:
    Spyder (formerly Pydee[3]) is an open-source cross-platform integrated development environment (IDE) for scientific programming in the Python language. Spyder integrates NumPy, SciPy, Matplotlib and IPython, as well as other open source software.[4][5] It is released under the MIT license.[6]
    Six days ago, a release of this IDE with version 3.2.7 was announced.
    This IDE can be download from GitHub page.

    Tuesday, December 5, 2017

    Fix PyCharm error install python module from conda .

    Today I fix an error about PyCharm and conda.
    As you know :
    Conda is an open source package management system and environmental management system that runs on Windows, macOS and Linux.
    Also, Conda quickly installs, runs and updates packages dependency and environment management for any language—Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN.
    This error is from PyCharm install python modules using error check from PyCharm (Alt+Enter keys):

    The result of this install come with this error from conda :

    Close your PyCharm and use this command into your shell-like administrator:
    
    C:\WINDOWS\system32>conda config --show
    C:\WINDOWS\system32>conda config --set force True
    C:\WINDOWS\system32>conda update conda
    C:\WINDOWS\system32>conda install conda anaconda
    Fetching package metadata .............
    Solving package specifications: .
    
    # All requested packages already installed.
    # packages in environment at C:\Users\catafest\Miniconda3:
    #
    anaconda                  5.0.1            py36h8316230_2
    conda                     4.3.30           py36h7e176b0_0
    C:\WINDOWS\system32>conda update --prefix C:\Users\catafest\Miniconda3 anaconda
    Fetching package metadata .............
    Solving package specifications: .
    
    Package plan for installation in environment C:\Users\catafest\Miniconda3:
    
    The following packages will be UPDATED:
    
        conda-env: 2.6.0-0 --> 2.6.0-h36134e3_1
    Proceed ([y]/n)? y
    
    conda-env-2.6. 100% |###############################| Time: 0:00:00 163.59 kB/s
    This command installs anaconda and updates it using my account catafest .
    Start the I.D.E. PyCharm and after indexing all you can try to fix the python install module (Alt+Enter keys).
    If the python modules are not into conda repo from PyCharm then you can use this command:
    C:\WINDOWS\system32>conda install -c conda-forge opencv
    Fetching package metadata ...............
    Solving package specifications: .
    
    # All requested packages already installed.
    # packages in environment at C:\Users\catafest\Miniconda3:
    #
    opencv                    3.3.0                  py36_202    conda-forge
    In this example I used OpenCV python module named into python script like cv2, see the next image:






    Wednesday, July 19, 2017

    PyCharm an integrated development environment.

    The development team comes with this integrated development environment (I.D.E.) named: PyCharm.
    They tell us about this integrated development environment:
    Python IDE with a complete set of tools for productive development with Python programming language. In addition, the IDE provides high-class capabilities for professional Web development with Django framework and Google App Engine. It has powerful coding assistance, navigation, a lot of refactoring features, tight integration with various Version Control Systems, Unit testing, powerful all-singing all-dancing Debugger, and entire customization. PyCharm is developer driven IDE. It was developed with the aim of providing you almost everything you need for your comfortable and productive development!
    I usually use it and from my point of view, it is very quick to learn and use.
    Also, some features like Servers come is supported in the Professional edition only.
    The menu is easy to remember and the project settings come automatically.
    You can start from the main menu: File - New Project...
    A little more complicated element is putting new scripts into the project File - New.
    The python file can be added and the type of python version can by editing the configuration menu: Run - Edit Configurations...
    The editor comes with unindent and convert fro tabs and spaces.
    This I.D.E. comes with common version control operations integrations, like:
    • CVS Reference
    • Git Reference
    • Mercurial Reference
    • Perforce Reference
    • Subversion Reference
    Also, some official tutorials can also be found on the official website.
    You can read more about this software here.

    The JetBrainsTV is the official youtube channel of this I.D.E.