{"id":15657803,"url":"https://github.com/pythonicninja/pydrill_dsl","last_synced_at":"2025-10-23T20:52:06.680Z","repository":{"id":53535453,"uuid":"57602185","full_name":"PythonicNinja/pydrill_dsl","owner":"PythonicNinja","description":"PyDrill DSL","archived":false,"fork":false,"pushed_at":"2022-12-26T19:44:56.000Z","size":53,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T04:46:14.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pydrill_dsl.readthedocs.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PythonicNinja.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-01T14:41:33.000Z","updated_at":"2016-06-01T08:29:02.000Z","dependencies_parsed_at":"2023-01-31T01:00:53.180Z","dependency_job_id":null,"html_url":"https://github.com/PythonicNinja/pydrill_dsl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fpydrill_dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fpydrill_dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fpydrill_dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PythonicNinja%2Fpydrill_dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PythonicNinja","download_url":"https://codeload.github.com/PythonicNinja/pydrill_dsl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246266590,"owners_count":20749819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:09:49.600Z","updated_at":"2025-10-23T20:52:06.593Z","avatar_url":"https://github.com/PythonicNinja.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===============================\npyDrill-dsl\n===============================\n\n.. image:: https://img.shields.io/travis/PythonicNinja/pydrill_dsl.svg\n        :target: https://travis-ci.org/PythonicNinja/pydrill_dsl\n\n.. image:: https://img.shields.io/pypi/v/pydrill_dsl.svg\n        :target: https://pypi.python.org/pypi/pydrill_dsl\n\n.. image:: https://readthedocs.org/projects/pydrill_dsl/badge/?version=latest\n        :target: https://readthedocs.org/projects/pydrill_dsl/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://coveralls.io/repos/github/PythonicNinja/pydrill_dsl/badge.svg\n        :target: https://coveralls.io/github/PythonicNinja/pydrill_dsl\n\n\nPythonic DSL for `Apache Drill \u003chttps://drill.apache.org/\u003e`_.\n\n*Schema-free SQL Query Engine for Hadoop, NoSQL and Cloud Storage*\n\n* Free software: MIT license\n* Documentation: https://pydrill_dsl.readthedocs.org.\n\nFeatures\n--------\n\n* Uses Peewee syntax. `examples for selecting data are in peewee docs \u003chttp://docs.peewee-orm.com/en/latest/peewee/querying.html#selecting-a-single-record\u003e`_.\n* Support for all storage plugins\n* Support for drivers PyODBC and pyDrill\n\nInstallation\n------------\n::\n\nVersion from https://pypi.python.org/pypi/pydrill_dsl::\n\n    $ pip install pydrill_dsl\n\nLatest version from git::\n\n    $ pip install git+git://github.com/PythonicNinja/pydrill_dsl.git\n\nSample usage\n------------\n::\n\n    from pydrill_dsl.resource import Resource\n\n    class Employee(Resource):\n        first_name = Field()\n        salary = Field()\n        position_id = Field()\n        department_id = Field()\n\n        class Meta:\n            storage_plugin = 'cp'\n            path = 'employee.json'\n            # by default it uses pydrill\n            # example of using pydobc\n            # database = Drill({'dsn': 'Driver=/opt/mapr/drillodbc/lib/universal/libmaprdrillodbc.dylib;ConnectionType=Direct;Host=127.0.0.1;Port=31010;Catalog=DRILL;AuthenticationType=Basic Authentication;AdvancedProperties=CastAnyToVarchar=true;HandshakeTimeout=5;QueryTimeout=180;TimestampTZDisplayTimezone=utc;ExcludedSchemas=sys,INFORMATION_SCHEMA;NumberOfPrefetchBuffers=5;UID=[USERNAME];PWD=[PASSWORD]'})\n\n    Employee.select().filter(salary__gte=17000)\n\n    Employee.select().paginate(page=1, paginate_by=5)\n\n\n    salary_gte_17K = (Employee.salary \u003e= 17000)\n    salary_lte_25K = (Employee.salary \u003c= 25000)\n    Employee.select().where(salary_gte_17K \u0026 salary_lte_25K)\n\n    Employee.select(\n        fn.Min(Employee.salary).alias('salary_min'),\n        fn.Max(Employee.salary).alias('salary_max')\n    ).scalar(as_tuple=True)\n\n    # creation of resource can be done without creation of class:\n    employee = Resource(storage_plugin='cp', path='employee.json',\n                        fields=('first_name', 'salary', 'position_id', 'department_id'))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonicninja%2Fpydrill_dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythonicninja%2Fpydrill_dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonicninja%2Fpydrill_dsl/lists"}