Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Python OAR Common Library

Read Configuration

>>> from oar import config
>>>
>>> config.load_file("/path/to/config")
True
>>> config["ENERGY_SAVING_INTERNAL"]
'no'
>>> config.get_namespace('OARSUB_')
{'default_resources': '/resource_id=1', 'force_job_key': 'no', 'nodes_resources': 'network_address'}

Query the database

>>> from oar import db, Resource
>>> db
<Database engine=None>
>>> db.query(Resource).first()
<oar.models.Resource object at 0x2becb10>
>>> Resource.query.first()
<oar.models.Resource object at 0x2becb10>
>>> db
<Database engine=Engine(postgresql://oar:***@server:5432/oar)>
>>> for r in Resource.query.filter(Resource.core > 3).limit(2):
...     print(r.id, r.network_address)
...
(12L, u'node3')
(9L, u'node3')
>>> req = db.query(Resource.id, Resource.network_address)
>>> req.filter(Resource.core > 3).limit(2).all()
[(12L, u'node3'), (9L, u'node3')]

Logger

Logging from the root logger:

>> from oar import logger as log
>> log.info("Init confiuration")
## [INFO] [2014-12-05 14:13:42,239] [oar]: Init confiuration

Logging from your own sublogger:

>> from oar import get_logger
>> log = get_logger("oar.kao")
>> log.error("fatal error")
## [ERROR] [2014-12-05 14:14:32,116] [oar.kao]: fatal error

Metadata

Release files for oar-lib 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oar-lib 0.1.1
File Size Uploaded Provenance Actions
oar-lib-0.1.1-1.tar.gz 12.4 kB Without provenance Details for oar-lib-0.1.1-1.tar.gz

Release files / oar-lib-0.1.1-1.tar.gz

Download URL oar-lib-0.1.1-1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4e1d14272ec186740a287a62112ac51325871a104b99732e5fd2cafcf89fd920
BLAKE2b-256 checksum
How to use checksums
1dfd89eb7c3ccf31efbc8575bafa8a629e58c7e6518c35c7860cee5740f175b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for oar-lib 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page