{ "info": { "author": "Kim Gr\u00e4sman", "author_email": "kim.grasman@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Code Generators" ], "description": "asn1ate -- ASN.1 translation library.\nCopyright 2013-2017 Schneider Electric Buildings AB\n\nIntroduction\n------------\n\n``asn1ate`` is a Python library for translating ASN.1 into other forms.\nIt is intended for code generation from formal ASN.1 definitions, and a\ncode generator for ``pyasn1`` is included.\n\n``asn1ate`` is released under a 3-clause BSD license. For details, see\nLICENSE.txt.\n\n\nCaveat\n------\n\nThis is very much an alpha-quality prototype. Things that need doing:\n\n* Regression test suite\n* HACK/TODO/BUGs need to be fixed\n* ASN.1 grammar is very incomplete in some places. Known issues:\n\n - Constraint syntax is currently limited to simple value range constraints (ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12.asn, line 53)\n - Reference syntax is not accepted at all (ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12.asn, line 74)\n\n* Improve parser error handling/reporting\n* Allow for semantic analysis, e.g. validity check, warnings for problematic\n constructs, etc.\n\n\nUsage\n-----\n\nThe immediate use of ``asn1ate`` is to generate ``pyasn1`` definitions from\nASN.1 definitions. The command to do this is::\n\n $ python .../asn1ate/pyasn1gen.py source.asn1\n\nIt will print the ``pyasn1`` equivalent of ``source.asn1`` to stdout.\n\nBut ``asn1ate`` is also designed to be usable as a library, to allow reuse of\nthe ASN.1 parser for custom code generation.\n\n\nCaveat #2\n---------\n\nMy understanding of ASN.1 syntax and semantics is limited. As I learn and\ndiscover more, the design *will* change. I will always prioritize a better model\nbefore API stability for the foreseeable future.\n\nSo if you're using ``asn1ate`` as a library for custom codegen, please be aware\nthat every release will likely break something for you.\n\nThe in-tree ``pyasn1`` code generator will be kept up-to-date, of course, and\nmay serve as an example of different codegen tasks,\n\n\nDependencies\n------------\n\nThe only third-party dependency is ``pyparsing``.\n\nAlthough ``asn1ate`` was initially developed on Python 3.2, it has been tested\nwith Python 2.7 and should port to older Python versions easily. Latest release\ntested with:\n\n* Python 3.6.3\n* Python 2.7.14\n\n\nDesign notes\n------------\n\nThe ``asn1ate`` package is designed along the same lines as a compiler with a\ndriver, a parser, a semantic model and a convention for code generators.\n\n* ``parser.py`` -- a tokenizing parser for ASN.1 per X.680. It currently\n recognizes a naive sub-set of X.680\n* ``sema.py`` -- a semantic ASN.1 object model, which can be constructed from\n the AST generated by ``parser.py``\n* ``support/pygen.py`` -- a support library for generating Python code.\n* ``pyasn1gen.py`` -- a code generator to transform a semantic model into\n ``pyasn1`` syntax. This can be used as a script in which case it will dump\n output to stdout.\n\nThe ASN.1 parser is very ad-hoc, I've experimented with the grammar until I\nfound something that accepted our proprietary ASN.1 definition. It's based on\n``pyparsing`` but sets up parse actions to build an annotated AST. Every node of\ninterest is annotated with a string denoting its type, e.g. ``Identifier``,\n``TypeAssignment``, etc. I've tried to stay with token types as named in X.680,\nbut added custom ones or suppressed others, as necessary to get the AST in a\nuseful shape.\n\nAnnotated tokens are represented by a simple class containing the type name and\na list of children (called ``elements``) which may be annotated tokens, lists or\nsimple values. This gives a very discoverable tree structure, but there are\nprobably cleaner AST representations we could use. Patches welcome.\n\n``asn1ate.sema`` is an object model that represents ASN.1 constructs. It\ndescribes everything from type assignments to default values and tags, but still\nonly the parts of ASN.1 we happen to use here. Most of the logic revolves around\ntransforming the AST produced by ``asn1ate.parser`` into a more semantic model\nwith proper Python objects.\n\nCodegen is designed to be extensible. In-house we have a set of code generators\nto build an entire protocol stack based on an ASN.1 source, but ``asn1ate`` only\nincludes the generally useful one, ``asn1ate.pyasn1gen``.\n\nThe most notable members of ``asn1ate.support`` are probably the\n``PythonWriter`` and ``PythonFragment`` classes, which simplify generation of\ncorrectly indented Python code.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/kimgr/asn1ate", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "asn1ate", "package_url": "https://pypi.org/project/asn1ate/", "platform": "any", "project_url": "https://pypi.org/project/asn1ate/", "project_urls": { "Homepage": "http://github.com/kimgr/asn1ate" }, "release_url": "https://pypi.org/project/asn1ate/0.6.0/", "requires_dist": null, "requires_python": "", "summary": "ASN.1 translation library.", "version": "0.6.0" }, "last_serial": 3305339, "releases": { "0.4": [ { "comment_text": "", "digests": { "md5": "135e10f060adafaa6c687cd2cba25b3e", "sha256": "1b9979c05e6c71d10686fc3327dd102c70562a872b8f27b208850dacef5e816f" }, "downloads": -1, "filename": "asn1ate-0.4.tar.gz", "has_sig": false, "md5_digest": "135e10f060adafaa6c687cd2cba25b3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16464, "upload_time": "2014-06-02T18:35:26", "url": "https://files.pythonhosted.org/packages/07/ab/1bd5c0ede3899d526edc6bee1f6dd83f30a15edc012122a9aaabb625366a/asn1ate-0.4.tar.gz" }, { "comment_text": "", "digests": { "md5": "f24a2997e3ff23ba287d67d10e1efe47", "sha256": "2af5e827e2e98b10330be06f8d821584867abeec601017c92198be442476418f" }, "downloads": -1, "filename": "asn1ate-0.4.zip", "has_sig": false, "md5_digest": "f24a2997e3ff23ba287d67d10e1efe47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24058, "upload_time": "2014-06-02T18:35:22", "url": "https://files.pythonhosted.org/packages/dc/40/77a708eb914d32be6329d66afb20a8715de75b5c28c56b273d116185d4ed/asn1ate-0.4.zip" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "5f1eb93600a9d40022e4aa5d415769db", "sha256": "f3c84b3a626e2251e8f64d5e594512c8939584872491a3f82d04bc52dc416652" }, "downloads": -1, "filename": "asn1ate-0.5.tar.gz", "has_sig": false, "md5_digest": "5f1eb93600a9d40022e4aa5d415769db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20119, "upload_time": "2015-03-15T09:07:37", "url": "https://files.pythonhosted.org/packages/2d/1f/0105593d84305e80bd9281eede3498c137d49b62776c84adf4b1e6ea47f4/asn1ate-0.5.tar.gz" }, { "comment_text": "", "digests": { "md5": "1bb919ac7eaaa8a5408e3f21bdcc3e22", "sha256": "e789432a3b085a281c4329df51f51d7d66834f4d878db45ca548fd700abe9278" }, "downloads": -1, "filename": "asn1ate-0.5.zip", "has_sig": false, "md5_digest": "1bb919ac7eaaa8a5408e3f21bdcc3e22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28113, "upload_time": "2015-03-15T09:07:34", "url": "https://files.pythonhosted.org/packages/65/59/e3fdcbb7dc2e19ab5b132901a4115446070b20bccac86945f3e78ce5f32d/asn1ate-0.5.zip" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "bcea600b9a66afd45676e4c31939595b", "sha256": "fe2cb928b1187cbd255272f2dc1df600f42d8810845b65e0f8d0551fbcd2c7ab" }, "downloads": -1, "filename": "asn1ate-0.6.0.tar.gz", "has_sig": false, "md5_digest": "bcea600b9a66afd45676e4c31939595b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24867, "upload_time": "2017-11-04T11:02:29", "url": "https://files.pythonhosted.org/packages/ec/20/7310475955a893ddd0beb7c8a9b1f940390d67bc46cae9d60c7bc7566d5c/asn1ate-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bcea600b9a66afd45676e4c31939595b", "sha256": "fe2cb928b1187cbd255272f2dc1df600f42d8810845b65e0f8d0551fbcd2c7ab" }, "downloads": -1, "filename": "asn1ate-0.6.0.tar.gz", "has_sig": false, "md5_digest": "bcea600b9a66afd45676e4c31939595b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24867, "upload_time": "2017-11-04T11:02:29", "url": "https://files.pythonhosted.org/packages/ec/20/7310475955a893ddd0beb7c8a9b1f940390d67bc46cae9d60c7bc7566d5c/asn1ate-0.6.0.tar.gz" } ] }