ldlite


Nameldlite JSON
Version 0.0.36 PyPI version JSON
download
home_pagehttps://github.com/library-data-platform/ldlite
SummaryLightweight analytics tool for Okapi-based services
upload_time2023-01-13 20:26:51
maintainer
docs_urlNone
authorNassib Nassar
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            LDLite
======

Copyright (C) 2021-2022 The Open Library Foundation. This software is
distributed under the terms of the Apache License, Version 2.0. See
the file
[LICENSE](https://github.com/library-data-platform/ldlite/blob/master/LICENSE)
for more information.

LDLite is a lightweight, open source reporting tool for Okapi-based
services. It is part of the Library Data Platform project and
provides basic LDP functions without requiring the server to be
installed.

To install LDLite or upgrade to the latest version:

```bash
$ python -m pip install --upgrade ldlite
```

(On some systems it might be `python3` rather than `python`.)

To extract and transform data:

```python
$ python
>> > import ldlite
>> > ld = ldlite.LDLite()
>> > ld.connect_okapi(url='https://folio-juniper-okapi.dev.folio.org/',
                      tenant='diku',
                      user='diku_admin',
                      password='admin')
>> > db = ld.connect_db()
>> > _ = ld.query(table='g', path='/groups', query='cql.allRecords=1 sortby id')
ldlite: querying: / groups
ldlite: created
tables: g, g__t, g__tcatalog
>> > ld.select(table='g__t')
```

```
 __id |                  id                  |         desc          | expiration_offset_in_days |   group   
------+--------------------------------------+-----------------------+---------------------------+-----------
    1 | 3684a786-6671-4268-8ed0-9db82ebca60b | Staff Member          |                       730 | staff     
    2 | 503a81cd-6c26-400f-b620-14c08943697c | Faculty Member        |                       365 | faculty   
    3 | ad0bc554-d5bc-463c-85d1-5562127ae91b | Graduate Student      |                           | graduate  
    4 | bdc2b6d4-5ceb-4a12-ab46-249b9a68473e | Undergraduate Student |                           | undergrad 
(4 rows)
```

```python
>> > _ = ld.query(table='u', path='/users', query='cql.allRecords=1 sortby id')
ldlite: querying: / users
ldlite: created
tables: u, u__t, u__t__departments, u__t__personal__addresses, u__t__proxy_for, u__tcatalog
>> > cur = db.cursor()
>> > _ = cur.execute("""
        CREATE TABLE user_groups AS
        SELECT u__t.id, u__t.username, g__t.group
            FROM u__t
                JOIN g__t ON u__t.patron_group = g__t.id;
        """)
>> > ld.export_excel(table='user_groups', filename='groups.xlsx')
```

Features
--------

* Queries Okapi-based modules and transforms JSON data into tables for
  easier reporting
* Full SQL query support and export to CSV or Excel
* Compatible with DBeaver database tool
* Compatible with DuckDB and PostgreSQL database systems
* PostgreSQL support enables:
    * Sharing the data in a multiuser database
    * Access to the data using more database tools
    * Storing the data in an existing LDP database if available
* Runs on Windows, macOS, and Linux.

More examples
-------------

* [An example running in Jupyter
  Notebook](https://github.com/library-data-platform/ldlite/blob/main/examples/example.md)

* [Loading sample data from FOLIO demo
  sites](https://github.com/library-data-platform/ldlite/blob/main/examples/folio_demo.py)

* [Using LDLite with SRS MARC data](https://github.com/library-data-platform/ldlite/blob/main/srs.md)

LDLite resources
----------------

* [LDLite API documentation](https://library-data-platform.github.io/ldlite/ldlite.html)

* The LDP project runs a Slack workspace which is a good place to ask
  questions or to share your work. It also serves as a community space
  for working together on library data problems. To request an invitation,
  use the [Contact page](https://librarydataplatform.org/contact/)
  on the LDP website.

* Report bugs at [Issues](https://github.com/library-data-platform/ldlite/issues)

Other resources
---------------

* [FOLIO API documentation](https://dev.folio.org/reference/api/)

* [Python learning resources](https://www.python.org/about/gettingstarted/)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/library-data-platform/ldlite",
    "name": "ldlite",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Nassib Nassar",
    "author_email": "nassib@indexdata.com",
    "download_url": "https://files.pythonhosted.org/packages/c9/44/4adbd7c96ec76f5506a2dfc8448afc46ccc49c1faf1a86e64e795c1e1a75/ldlite-0.0.36.tar.gz",
    "platform": null,
    "description": "LDLite\n======\n\nCopyright (C) 2021-2022 The Open Library Foundation. This software is\ndistributed under the terms of the Apache License, Version 2.0. See\nthe file\n[LICENSE](https://github.com/library-data-platform/ldlite/blob/master/LICENSE)\nfor more information.\n\nLDLite is a lightweight, open source reporting tool for Okapi-based\nservices. It is part of the Library Data Platform project and\nprovides basic LDP functions without requiring the server to be\ninstalled.\n\nTo install LDLite or upgrade to the latest version:\n\n```bash\n$ python -m pip install --upgrade ldlite\n```\n\n(On some systems it might be `python3` rather than `python`.)\n\nTo extract and transform data:\n\n```python\n$ python\n>> > import ldlite\n>> > ld = ldlite.LDLite()\n>> > ld.connect_okapi(url='https://folio-juniper-okapi.dev.folio.org/',\n                      tenant='diku',\n                      user='diku_admin',\n                      password='admin')\n>> > db = ld.connect_db()\n>> > _ = ld.query(table='g', path='/groups', query='cql.allRecords=1 sortby id')\nldlite: querying: / groups\nldlite: created\ntables: g, g__t, g__tcatalog\n>> > ld.select(table='g__t')\n```\n\n```\n __id |                  id                  |         desc          | expiration_offset_in_days |   group   \n------+--------------------------------------+-----------------------+---------------------------+-----------\n    1 | 3684a786-6671-4268-8ed0-9db82ebca60b | Staff Member          |                       730 | staff     \n    2 | 503a81cd-6c26-400f-b620-14c08943697c | Faculty Member        |                       365 | faculty   \n    3 | ad0bc554-d5bc-463c-85d1-5562127ae91b | Graduate Student      |                           | graduate  \n    4 | bdc2b6d4-5ceb-4a12-ab46-249b9a68473e | Undergraduate Student |                           | undergrad \n(4 rows)\n```\n\n```python\n>> > _ = ld.query(table='u', path='/users', query='cql.allRecords=1 sortby id')\nldlite: querying: / users\nldlite: created\ntables: u, u__t, u__t__departments, u__t__personal__addresses, u__t__proxy_for, u__tcatalog\n>> > cur = db.cursor()\n>> > _ = cur.execute(\"\"\"\n        CREATE TABLE user_groups AS\n        SELECT u__t.id, u__t.username, g__t.group\n            FROM u__t\n                JOIN g__t ON u__t.patron_group = g__t.id;\n        \"\"\")\n>> > ld.export_excel(table='user_groups', filename='groups.xlsx')\n```\n\nFeatures\n--------\n\n* Queries Okapi-based modules and transforms JSON data into tables for\n  easier reporting\n* Full SQL query support and export to CSV or Excel\n* Compatible with DBeaver database tool\n* Compatible with DuckDB and PostgreSQL database systems\n* PostgreSQL support enables:\n    * Sharing the data in a multiuser database\n    * Access to the data using more database tools\n    * Storing the data in an existing LDP database if available\n* Runs on Windows, macOS, and Linux.\n\nMore examples\n-------------\n\n* [An example running in Jupyter\n  Notebook](https://github.com/library-data-platform/ldlite/blob/main/examples/example.md)\n\n* [Loading sample data from FOLIO demo\n  sites](https://github.com/library-data-platform/ldlite/blob/main/examples/folio_demo.py)\n\n* [Using LDLite with SRS MARC data](https://github.com/library-data-platform/ldlite/blob/main/srs.md)\n\nLDLite resources\n----------------\n\n* [LDLite API documentation](https://library-data-platform.github.io/ldlite/ldlite.html)\n\n* The LDP project runs a Slack workspace which is a good place to ask\n  questions or to share your work. It also serves as a community space\n  for working together on library data problems. To request an invitation,\n  use the [Contact page](https://librarydataplatform.org/contact/)\n  on the LDP website.\n\n* Report bugs at [Issues](https://github.com/library-data-platform/ldlite/issues)\n\nOther resources\n---------------\n\n* [FOLIO API documentation](https://dev.folio.org/reference/api/)\n\n* [Python learning resources](https://www.python.org/about/gettingstarted/)\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Lightweight analytics tool for Okapi-based services",
    "version": "0.0.36",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0533cdc6e690dab9dbba6864793daffbfc6da7d2132df417bfdebc152095289",
                "md5": "a418026c7ffdc26554ac0c34ed6f6e15",
                "sha256": "17781d5dd79c4ec5f1add437ead51d111f9a2c0d463f63d4a46c367bd6b0a3f1"
            },
            "downloads": -1,
            "filename": "ldlite-0.0.36-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a418026c7ffdc26554ac0c34ed6f6e15",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 21530,
            "upload_time": "2023-01-13T20:26:49",
            "upload_time_iso_8601": "2023-01-13T20:26:49.359941Z",
            "url": "https://files.pythonhosted.org/packages/b0/53/3cdc6e690dab9dbba6864793daffbfc6da7d2132df417bfdebc152095289/ldlite-0.0.36-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9444adbd7c96ec76f5506a2dfc8448afc46ccc49c1faf1a86e64e795c1e1a75",
                "md5": "c6e043137e4306d7e007868c3ff828e2",
                "sha256": "dde015720c4b242dffba3bf8fb606cfcb782ef989fd4634c7f259bb1b28837fc"
            },
            "downloads": -1,
            "filename": "ldlite-0.0.36.tar.gz",
            "has_sig": false,
            "md5_digest": "c6e043137e4306d7e007868c3ff828e2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 20036,
            "upload_time": "2023-01-13T20:26:51",
            "upload_time_iso_8601": "2023-01-13T20:26:51.306832Z",
            "url": "https://files.pythonhosted.org/packages/c9/44/4adbd7c96ec76f5506a2dfc8448afc46ccc49c1faf1a86e64e795c1e1a75/ldlite-0.0.36.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-13 20:26:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "library-data-platform",
    "github_project": "ldlite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "ldlite"
}
        
Elapsed time: 0.03146s