ctidb


Namectidb JSON
Version 1.1.10 PyPI version JSON
download
home_pagehttps://github.com/aispera/ctidb
Summarycriminalip.ctidb reader
upload_time2024-05-08 01:35:07
maintainerNone
docs_urlNone
authoraispera
requires_python>=3.6
licenseApache License, Version 2.0
keywords aispera ctidb criminalip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========================
CTI DB Python Module
========================

Description
-----------

This is a Python module for reading CTI DB files.

CTI DB is a binary file format that stores data indexed by IP address
subnets (IPv4 only).

Installation
------------

To install ctidb, simply:

.. code-block:: bash

    $ pip install ctidb

Usage
-----

To use this module, you must first download or create a CTI DB file.

After you have obtained a database and imported the module, call
``CCtiReader`` with a path,
to the database as the first argument. Optionally, you may pass a mode as the
second argument. The modes are exported from ``ctidb``. Valid modes are:

* ``MODE_MEMORY`` - load database into memory. Pure Python.
* ``MODE_AUTO`` - Default.

**NOTE**:
To look up an IP address, use the ``get`` method on this object. The method will return the
corresponding values for the IP address from the database (e.g., a dictionary
for GeoIP2/GeoLite2 databases). If the database does not contain a record for
that IP address, the method will return ``None``.

Example
-------

.. code-block:: pycon

    >>> import ctidb
    >>>
    >>> with ctidb.CCtiReader('criminalip.ctidb') as reader:
    >>>
    >>>     reader.get('223.26.31.75')
    {'country': ... }

Exceptions
----------

The module will return an ``InvalidDatabaseError`` if the database is corrupt
or otherwise invalid. A ``ValueError`` will be thrown if you look up an
invalid IP address or an IPv6 address in an IPv4 database.

Requirements
------------

This code requires Python 3.7+. Older versions are not supported.

Versioning
----------



Support
-------

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aispera/ctidb",
    "name": "ctidb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "aispera, ctidb, criminalip",
    "author": "aispera",
    "author_email": "infra@aispera.com",
    "download_url": "https://files.pythonhosted.org/packages/e0/a0/cb241c0aae34384146566f2e85a9f2e245b94d4a2c1161bc4657ccae66a1/ctidb-1.1.10.tar.gz",
    "platform": null,
    "description": "========================\nCTI DB Python Module\n========================\n\nDescription\n-----------\n\nThis is a Python module for reading CTI DB files.\n\nCTI DB is a binary file format that stores data indexed by IP address\nsubnets (IPv4 only).\n\nInstallation\n------------\n\nTo install ctidb, simply:\n\n.. code-block:: bash\n\n    $ pip install ctidb\n\nUsage\n-----\n\nTo use this module, you must first download or create a CTI DB file.\n\nAfter you have obtained a database and imported the module, call\n``CCtiReader`` with a path,\nto the database as the first argument. Optionally, you may pass a mode as the\nsecond argument. The modes are exported from ``ctidb``. Valid modes are:\n\n* ``MODE_MEMORY`` - load database into memory. Pure Python.\n* ``MODE_AUTO`` - Default.\n\n**NOTE**:\nTo look up an IP address, use the ``get`` method on this object. The method will return the\ncorresponding values for the IP address from the database (e.g., a dictionary\nfor GeoIP2/GeoLite2 databases). If the database does not contain a record for\nthat IP address, the method will return ``None``.\n\nExample\n-------\n\n.. code-block:: pycon\n\n    >>> import ctidb\n    >>>\n    >>> with ctidb.CCtiReader('criminalip.ctidb') as reader:\n    >>>\n    >>>     reader.get('223.26.31.75')\n    {'country': ... }\n\nExceptions\n----------\n\nThe module will return an ``InvalidDatabaseError`` if the database is corrupt\nor otherwise invalid. A ``ValueError`` will be thrown if you look up an\ninvalid IP address or an IPv6 address in an IPv4 database.\n\nRequirements\n------------\n\nThis code requires Python 3.7+. Older versions are not supported.\n\nVersioning\n----------\n\n\n\nSupport\n-------\n",
    "bugtrack_url": null,
    "license": "Apache License, Version 2.0",
    "summary": "criminalip.ctidb reader",
    "version": "1.1.10",
    "project_urls": {
        "Homepage": "https://github.com/aispera/ctidb"
    },
    "split_keywords": [
        "aispera",
        " ctidb",
        " criminalip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c3afe61c55fc34f7df9d6ff6bf38a5933e47a425d9f531c6fc4028c29384a8c6",
                "md5": "afa8100ca53c3d7e77fb3825c91f1bc7",
                "sha256": "b41b63a1af60cf79de7ac619c1e0e717f1be6fc62acac976456b7213c3228fe4"
            },
            "downloads": -1,
            "filename": "ctidb-1.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "afa8100ca53c3d7e77fb3825c91f1bc7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13348,
            "upload_time": "2024-05-08T01:35:04",
            "upload_time_iso_8601": "2024-05-08T01:35:04.975491Z",
            "url": "https://files.pythonhosted.org/packages/c3/af/e61c55fc34f7df9d6ff6bf38a5933e47a425d9f531c6fc4028c29384a8c6/ctidb-1.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0a0cb241c0aae34384146566f2e85a9f2e245b94d4a2c1161bc4657ccae66a1",
                "md5": "e78a38408a7321a2adb50619f4bbf38c",
                "sha256": "7060900458b65286951a703ecfb370071c8f82aef848a92c59e4afcef89d4d33"
            },
            "downloads": -1,
            "filename": "ctidb-1.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "e78a38408a7321a2adb50619f4bbf38c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 13418,
            "upload_time": "2024-05-08T01:35:07",
            "upload_time_iso_8601": "2024-05-08T01:35:07.709308Z",
            "url": "https://files.pythonhosted.org/packages/e0/a0/cb241c0aae34384146566f2e85a9f2e245b94d4a2c1161bc4657ccae66a1/ctidb-1.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 01:35:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aispera",
    "github_project": "ctidb",
    "github_not_found": true,
    "lcname": "ctidb"
}
        
Elapsed time: 0.25079s