Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.0%) to scientific vocabulary
Keywords from Contributors
Repository
YAML configuration manager
Basic Info
- Host: GitHub
- Owner: databio
- License: bsd-2-clause
- Language: Python
- Default Branch: master
- Homepage: https://pypi.org/project/yacman
- Size: 352 KB
Statistics
- Stars: 6
- Watchers: 15
- Forks: 2
- Open Issues: 10
- Releases: 29
Metadata Files
README.md
Yacman is a YAML configuration manager. It provides some convenience tools for dealing with YAML configuration files.
Please see this Python notebook for features and usage instructions and this document for API documentation.
Upgrading guide
How to upgrade to yacman v1.0.0. Yacman v1 provides 2 feature upgrades:
- Constructors take the form of
yacman.YAMLConfigManager.from_x(...)functions, to make it clearer how to create a newymobject. - It separates locks into read locks and write locks, to allow mutliple simultaneous readers.
The v0.9.3 transition release has 3 versions of the basic yacman object, namely:
- attmap-based version (YacAttMap)
- non-attmap-but-mostly-compatible (YAMLConfigManager)
- new future object (FutureYAMLConfigManager...), which is explicitly not backwards compatible with the attmap version.
In v1.0.0, FutureYAMLConfigManager will be renamed to YAMLConfigManager and the old stuff will be removed. Here's how to transition your code:
Use the FutureYAMLConfigManager in 0.9.3
- Import the FutureYAMLConfigManager
Change from:
python
from yacman import YAMLConfigManager
to
python
from yacman import FutureYAMLConfigManager as YAMLConfigManager
Once we switch from v0.9.3 to v1.X.X, you will need to switch back.
- Update any context managers to use
write_lockorread_lock
python
from yacman import write_lock, read_lock
Change
python
with ym as locked_ym:
locked_ym.write()
to
python
with write_lock(ym) as locked_ym:
locked_ym.rebase()
locked_ym.write()
In the new system, you must use rebase() before write() if you want to allow for multiple processes to possibly have written the file since you read it in.
More examples:
```python
from yacman import FutureYAMLConfigManager as YAMLConfigManager from yacman import readlock, writelock
data = {"mylist": [1,2,3], "myint": 8, "mystr": "hello world!", "mydict": {"nested_val": 15}}
ym = YAMLConfigManager(data)
ym["mylist"] ym["myint"] ym["my_dict"]
Use in a context manager to write to the file
ym["new_var"] = 15
Use a write-lock, and rebase before writing to ensure you capture any changes since you loaded the file
with write(ym) as lockedym: lockedym.rebase() locked_ym.write()
use a read lock to rebase -- this will replay any in-memory updates on top of whatever is re-read from the file
with readlock(ym) as lockedym: locked_ym.rebase()
use a read lock to reset the in-memory object to whatever is on disk
with readlock(ym) as lockedym: locked_ym.reset()
```
- Update any constructors to use the
from_{x}functions
You can no longer just create a YAMLConfigManager object directly; now you need to use the constructor helpers.
Examples:
```python from yacman import FutureYAMLConfigManager as YAMLConfigManager
data = {"mylist": [1,2,3], "myint": 8, "mystr": "hello world!", "mydict": {"nestedval": 15}} filepath = "tests/data/full.yaml" yaml_data = "myvar: myval"
yacman.YAMLConfigManager.fromyamlfile(filepath) yacman.YAMLConfigManager.fromyamldata(yamldata) yacman.YAMLConfigManager.from_obj(data)
```
In the past, you could load from a file and overwrite some attributes with a dict of variables, all from the constructor. Now it would is more explicit:
python
ym = yacman.YacMan.from_yaml_file(file_path)
ym.update_from_obj(data)
To exppand environment variables in values, use .exp.
python
ym.exp["text_expand_home_dir"]
From v0.9.3 (using future) to v1.X.X:
Switch back to:
from yacman import YAMLConfigManager
Demos
Some interactive demos
```python from yacman import FutureYAMLConfigManager as YAMLConfigManager ym = yacman.YAMLConfigManager(entries=["a", "b", "c"]) ym.to_dict() ym
print(ym.to_yaml())
ym = YAMLConfigManager(entries={"top": {"bottom": ["a", "b"], "bottom2": "a"}, "b": "c"}) ym print(ym.to_yaml())
ym = YAMLConfigManager(filepath="tests/data/confschema.yaml") print(ym.toyaml()) ym
ym = YAMLConfigManager(filepath="tests/data/empty.yaml") print(ym.to_yaml())
ym = YAMLConfigManager(filepath="tests/data/list.yaml") print(ym.to_yaml())
ym = YAMLConfigManager(YAMLConfigManager(filepath="tests/data/full.yaml").exp) print(ym.to_yaml())
ym = YAMLConfigManager(filepath="tests/data/full.yaml") print(ym.to_yaml(expand=True))
```
Owner
- Name: Databio
- Login: databio
- Kind: organization
- Location: University of Virginia
- Website: https://databio.org
- Repositories: 88
- Profile: https://github.com/databio
Solving problems in computational biology
GitHub Events
Total
Last Year
Committers
Last synced: about 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Michal Stolarczyk | s****3@g****m | 167 |
| nsheff | n****f@u****m | 74 |
| Vince | v****r@g****m | 13 |
| nsheff | n****n@c****g | 9 |
| Nicola Soranzo | n****o@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 34
- Total pull requests: 31
- Average time to close issues: 6 months
- Average time to close pull requests: 4 days
- Total issue authors: 6
- Total pull request authors: 4
- Average comments per issue: 2.68
- Average comments per pull request: 0.61
- Merged pull requests: 31
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- nsheff (24)
- vreuter (4)
- stolarczyk (3)
- rcorces (1)
- afrendeiro (1)
- zz1874 (1)
Pull Request Authors
- nsheff (18)
- stolarczyk (12)
- vreuter (2)
- nsoranzo (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 48,703 last-month
- Total docker downloads: 30,558
-
Total dependent packages: 16
(may contain duplicates) -
Total dependent repositories: 47
(may contain duplicates) - Total versions: 70
- Total maintainers: 5
proxy.golang.org: github.com/databio/yacman
- Documentation: https://pkg.go.dev/github.com/databio/yacman#section-documentation
- License: bsd-2-clause
-
Latest release: v0.9.3
published over 2 years ago
Rankings
pypi.org: yacman
A standardized configuration object for reference genome assemblies
- Homepage: https://github.com/databio/yacman
- Documentation: https://yacman.readthedocs.io/
- License: BSD2
-
Latest release: 0.9.3
published over 2 years ago
Rankings
Maintainers (4)
spack.io: py-yacman
A YAML configuration manager.
- Homepage: https://github.com/databio/yacman
- License: []
-
Latest release: 0.8.4
published over 3 years ago
Rankings
Maintainers (1)
conda-forge.org: yacman
- Homepage: https://github.com/databio/yacman/
- License: BSD-2-Clause
-
Latest release: 0.8.4
published over 4 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- psf/black stable composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v1 composite
- attmap >=0.13.0
- jsonschema >=3.2.0
- oyaml *
- pyyaml >=3.13
- ubiquerg >=0.6.1
- pytest * test
- pytest-cov * test