httk-optimade¶
This site documents specifically the httk-optimade module. For the full documentation of httk₂ as a whole, see docs.httk.org.
httk-optimade is a httk₂ module providing a generic
implementation of the OPTIMADE protocol; the entry schemas it
serves are supplied by providers (such as httk-atomistic’s structure provider) through
the neutral httk.core.EntryProvider contract.
Quick links
Serving entry providers (usage guide): Serving entry providers
Worked examples (runnable scripts): Examples
Notebook: walking an OPTIMADE API in-process: Walking an OPTIMADE API in-process
How it works: How it works
API reference: Reference
Documentation
- Serving entry providers
- Examples
- Walking an OPTIMADE API in-process
- Setup
- The data
- The application, and a client bound straight to it
- 1.
/v1/info— what is served at all - 2.
/v1/files— an entry listing - 3.
?filter=— a numeric comparison - 4.
HAS— list membership - 5.
?sort=— ordering by a declared-sortable property - 6. Pagination — follow
links.next - 7.
?include=— a compound document - Where to go next
- Reference
- How it works
- API Reference
Quick start¶
Wire a backend into a BackendAdapter and serve it:
from httk.optimade import BackendAdapter, EntrySource, OptimadeConfig, serve
adapter = BackendAdapter(
store=my_store,
sources={
"structures": (EntrySource(target=MyStructureTable, fields=my_field_map),),
},
)
serve(adapter, OptimadeConfig(), port=8080)
A complete runnable example over an in-memory dataset is provided in
examples/demo_server/ in the repository.