Skip to content

Commit 3fc07d5

Browse files
deeenesclaude
andcommitted
Rename module to cachedir, change license to BSD-3-Clause
- Rename Python module from cache_manager to cachedir - Update all internal imports and references - Change license from GPL-3.0 to BSD-3-Clause - Bump to 0.1.2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 77c3b2a commit 3fc07d5

28 files changed

Lines changed: 79 additions & 727 deletions

.bumpversion.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[bumpversion]
2-
current_version = 0.1.1
2+
current_version = 0.1.2
33
commit = True
44
tag = True
55
files = pyproject.toml
6-
76
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
87
serialize = {major}.{minor}.{patch}

.coveragerc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[paths]
22
source =
3-
cache_manager
4-
*/site-packages/cache-manager
3+
cachedir
4+
*/site-packages/cachedir
55

66
[run]
77
branch = true
88
parallel = true
9-
source = cache_manager
9+
source = cachedir
1010
omit = */__init__.py
1111

1212
[report]

LICENSE

Lines changed: 28 additions & 674 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ The API centers around two types: `Cache` (manager) and `CacheItem` (one file +
5757
Minimal example:
5858

5959
```python
60-
import cache_manager as cm
61-
from cache_manager._status import Status
60+
import cachedir as cm
61+
from cachedir._status import Status
6262

6363
cache = cm.Cache(path="./my_cache")
6464
item = cache.create(
@@ -83,7 +83,7 @@ print(best, best.path)
8383
Run the included example script which downloads a real dataset and caches it:
8484

8585
```bash
86-
python scripts/hello_cache_manager.py
86+
python scripts/hello_cachedir.py
8787
```
8888

8989
## Configuration
@@ -97,19 +97,19 @@ Common item fields:
9797
- `uri` (str): a canonical identifier used for the hash key (together with `params`).
9898
- `params` (dict): serialized to the stable key; changing them yields a new key.
9999
- `attrs` (dict): typed attributes persisted to attribute tables for rich queries.
100-
- `status` (int): from `cache_manager._status.Status` (READY, WRITE, etc.).
100+
- `status` (int): from `cachedir._status.Status` (READY, WRITE, etc.).
101101
- `filename` (str): filename to be used in the cache; extension is auto-inferred.
102102

103-
Logging/session helpers are available under `cache_manager.session` and `cache_manager.log` if you want simple trace output.
103+
Logging/session helpers are available under `cachedir.session` and `cachedir.log` if you want simple trace output.
104104

105105
## Examples
106106

107107
1. Create or reuse an item with `best_or_new`.
108108

109109
```python
110110
import os
111-
import cache_manager as cm
112-
from cache_manager._status import Status
111+
import cachedir as cm
112+
from cachedir._status import Status
113113

114114
cache = cm.Cache(path="./my_cache")
115115
uri = "https://example.org/report.csv"
@@ -134,8 +134,8 @@ print("Using:", item.path)
134134
2. Query by attributes and metadata.
135135

136136
```python
137-
import cache_manager as cm
138-
from cache_manager._status import Status
137+
import cachedir as cm
138+
from cachedir._status import Status
139139

140140
cache = cm.Cache(path="./my_cache")
141141

@@ -161,8 +161,8 @@ for it in items:
161161
3. Open a cached file through `CacheItem.open`.
162162

163163
```python
164-
import cache_manager as cm
165-
from cache_manager._status import Status
164+
import cachedir as cm
165+
from cachedir._status import Status
166166

167167
cache = cm.Cache(path="./my_cache")
168168
item = cache.create(

cache_manager/_data/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
from pkg_infra.utils import _misc
2222
import platformdirs
2323

24-
from cache_manager._item import CacheItem
25-
from cache_manager._status import Status
26-
import cache_manager.utils as _utils
24+
from cachedir._item import CacheItem
25+
from cachedir._status import Status
26+
import cachedir.utils as _utils
2727
from . import _data
2828
from ._lock import Lock
2929

@@ -730,7 +730,7 @@ def move_in(
730730

731731
def reload(self):
732732
"""
733-
Reloads the cache_manager at the module level and reloads the current
733+
Reloads the cachedir at the module level and reloads the current
734734
instance of `Cache`
735735
"""
736736

cachedir/_data/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import functools as ft
2+
from pkg_infra import data
3+
4+
load = ft.partial(data.load, module="cachedir")

0 commit comments

Comments
 (0)