Metadata-Version: 2.2
Name: pyAtoM
Version: 0.4.1
Summary: Python library for the AtoM archival description and access platform API
Home-page: 
Author: James Carr
Author-email: drjamescarr@gmail.com
License: Apache License 2.0
Project-URL: Documentation, https://github.com/carj/pyAtoM
Project-URL: Source, https://github.com/carj/pyAtoM
Project-URL: Discussion Forum, https://github.com/carj/pyAtoM/discussions
Keywords: API Preservation
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Topic :: System :: Archiving
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: urllib3
Requires-Dist: certifi
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: requires-dist
Dynamic: summary

# pyAtoM

Python Library for the AtoM Archival Description Platform API

This library provides a Python class for working with the AtoM Archival Description Rest API

https://accesstomemory.org/en/docs/2.8/dev-manual/api/api-intro/

The Library provides APIs for the following:

* Get a record by its Slug
* Get a record by its identifier
* Search for records
* Download a digital object attached to a record
* List taxonomy terms 



## License

The package is available as open source under the terms of the Apache License 2.0


## Installation

pyAtoM is available from the Python Package Index (PyPI)

https://pypi.org/project/pyAtoM/

To install pyAtoM, simply run this simple command in your terminal of choice:


    $ pip install pyAtoM


## Examples

Finding records by Slug

    from pyAtoM import *

    client = AccessToMemory(username="demo@example.com", password="demo", server="demo.accesstomemory.org")

    slug: str = "my-slug"

    item: dict = client.get(slug)


Searching for all Records

    from pyAtoM import *

    client = AccessToMemory(username="demo@example.com", password="demo", server="demo.accesstomemory.org")

    for result in client.search():
        print(result)


Searching for Records with Query terms


    from pyAtoM import *

    client = AccessToMemory(username="demo@example.com", password="demo", server="demo.accesstomemory.org")

    queries: list = []

    queries.append(Query(query_value="horses", query_field=QueryField.title))
    queries.append(Query(query_value='Sudbury', query_operator=QueryOperator.or_terms, query_field=QueryField.all))

    for result in client.search(query_terms=queries):
        print(result)


