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.3.0

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.3.0
File Size Uploaded Provenance Actions
oar-lib-0.3.0-1.tar.gz 19.2 kB Without provenance Details for oar-lib-0.3.0-1.tar.gz

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

Download URL oar-lib-0.3.0-1.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
accc06d23b509b51d07fc5770ffe4b3dfe658562ca4667bd5a62e8a3f3940bed
BLAKE2b-256 checksum
How to use checksums
6725a168197868dca023f38437cfe837f550c0805a81146cebc99189fc59c323
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for oar-lib 0.3.0

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