btrcache 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- btrcache-0.1.0/.github/FUNDING.yml +2 -0
- btrcache-0.1.0/.github/release.yml +23 -0
- btrcache-0.1.0/.github/workflows/publish.yml +136 -0
- btrcache-0.1.0/.github/workflows/tests.yml +46 -0
- btrcache-0.1.0/.gitignore +219 -0
- btrcache-0.1.0/.pre-commit-config.yaml +12 -0
- btrcache-0.1.0/.python-version +1 -0
- btrcache-0.1.0/LICENSE +21 -0
- btrcache-0.1.0/PKG-INFO +96 -0
- btrcache-0.1.0/README.md +75 -0
- btrcache-0.1.0/pyproject.toml +86 -0
- btrcache-0.1.0/src/btrcache/__init__.py +9 -0
- btrcache-0.1.0/src/btrcache/__version__.py +24 -0
- btrcache-0.1.0/src/btrcache/asyncio/__init__.py +12 -0
- btrcache-0.1.0/src/btrcache/asyncio/cache.py +18 -0
- btrcache-0.1.0/src/btrcache/asyncio/decorators.py +395 -0
- btrcache-0.1.0/src/btrcache/cache.py +21 -0
- btrcache-0.1.0/src/btrcache/keys.py +213 -0
- btrcache-0.1.0/tests/__init__.py +7 -0
- btrcache-0.1.0/tests/test_keys.py +202 -0
- btrcache-0.1.0/uv.lock +337 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
changelog:
|
|
2
|
+
categories:
|
|
3
|
+
- title: New Features 🎉
|
|
4
|
+
labels:
|
|
5
|
+
- feature
|
|
6
|
+
|
|
7
|
+
- title: Bug Fixes 🐛
|
|
8
|
+
labels:
|
|
9
|
+
- bug
|
|
10
|
+
|
|
11
|
+
- title: Documentation 📚
|
|
12
|
+
labels:
|
|
13
|
+
- documentation
|
|
14
|
+
|
|
15
|
+
- title: Maintenance 🔧
|
|
16
|
+
labels:
|
|
17
|
+
- dependencies
|
|
18
|
+
- ci
|
|
19
|
+
- chore
|
|
20
|
+
|
|
21
|
+
- title: Other Changes 🔄
|
|
22
|
+
labels:
|
|
23
|
+
- "*"
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
PACKAGE_NAME: btrcache
|
|
10
|
+
OWNER_NAME: lucas.azdias
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
check:
|
|
14
|
+
name: Checking new release information
|
|
15
|
+
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Verifying workflow trigger
|
|
20
|
+
run: |
|
|
21
|
+
if [ "$GITHUB_REF_TYPE" != "tag" ]; then
|
|
22
|
+
echo "This workflow must be run from a tag."
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
- name: Extracting new version
|
|
27
|
+
id: extract
|
|
28
|
+
run: |
|
|
29
|
+
echo "NEW_VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
|
30
|
+
|
|
31
|
+
- name: Installing jq
|
|
32
|
+
run: sudo apt update && sudo apt install -y jq
|
|
33
|
+
|
|
34
|
+
- name: Fetching package latest version on PyPI
|
|
35
|
+
id: fetch
|
|
36
|
+
run: |
|
|
37
|
+
latest=$(curl -fsSL "https://pypi.org/pypi/$PACKAGE_NAME/json" |
|
|
38
|
+
jq -r '.info.version // "0.0.0"')
|
|
39
|
+
|
|
40
|
+
echo "LATEST_VERSION=$latest" >> "$GITHUB_OUTPUT"
|
|
41
|
+
|
|
42
|
+
- name: Comparing versions
|
|
43
|
+
env:
|
|
44
|
+
NEW_VERSION: ${{ steps.extract.outputs.NEW_VERSION }}
|
|
45
|
+
LATEST_VERSION: ${{ steps.fetch.outputs.LATEST_VERSION }}
|
|
46
|
+
run: |
|
|
47
|
+
HIGHEST=$(printf '%s\n%s\n' "$LATEST_VERSION" "$NEW_VERSION" | sort -V | tail -n1)
|
|
48
|
+
|
|
49
|
+
if [ "$HIGHEST" != "$NEW_VERSION" ] || [ "$NEW_VERSION" = "$LATEST_VERSION" ]; then
|
|
50
|
+
echo "Version $NEW_VERSION is not newer than $LATEST_VERSION."
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
echo "Version check passed."
|
|
55
|
+
|
|
56
|
+
tests:
|
|
57
|
+
name: Testing
|
|
58
|
+
uses: ./.github/workflows/tests.yml
|
|
59
|
+
|
|
60
|
+
build:
|
|
61
|
+
name: Building
|
|
62
|
+
needs: [check, tests]
|
|
63
|
+
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
|
|
66
|
+
steps:
|
|
67
|
+
- name: Doing checkout
|
|
68
|
+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
69
|
+
|
|
70
|
+
- name: "Setting up Python"
|
|
71
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
72
|
+
with:
|
|
73
|
+
python-version-file: ".python-version"
|
|
74
|
+
|
|
75
|
+
- name: Installing `uv`
|
|
76
|
+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
77
|
+
|
|
78
|
+
- name: Syncing dependencies
|
|
79
|
+
run: uv sync --frozen
|
|
80
|
+
|
|
81
|
+
- name: Building redistributables
|
|
82
|
+
run: uv build
|
|
83
|
+
|
|
84
|
+
- name: Uploading artifacts
|
|
85
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
86
|
+
with:
|
|
87
|
+
name: ${{ env.PACKAGE_NAME }}-dist
|
|
88
|
+
path: dist/*
|
|
89
|
+
|
|
90
|
+
pypi_publish:
|
|
91
|
+
name: PyPI publishing
|
|
92
|
+
needs: build
|
|
93
|
+
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
|
|
96
|
+
environment:
|
|
97
|
+
name: pypi
|
|
98
|
+
|
|
99
|
+
permissions:
|
|
100
|
+
id-token: write
|
|
101
|
+
|
|
102
|
+
steps:
|
|
103
|
+
- name: Downloading artifacts
|
|
104
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
105
|
+
with:
|
|
106
|
+
name: ${{ env.PACKAGE_NAME }}-dist
|
|
107
|
+
path: dist
|
|
108
|
+
|
|
109
|
+
- name: Installing `uv`
|
|
110
|
+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
111
|
+
|
|
112
|
+
- name: Publishing redistributables
|
|
113
|
+
run: uv publish dist/*
|
|
114
|
+
|
|
115
|
+
github_release:
|
|
116
|
+
name: Releasing on Github
|
|
117
|
+
needs: build
|
|
118
|
+
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
|
|
121
|
+
permissions:
|
|
122
|
+
contents: write
|
|
123
|
+
|
|
124
|
+
steps:
|
|
125
|
+
- name: Downloading artifacts
|
|
126
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
127
|
+
with:
|
|
128
|
+
name: ${{ env.PACKAGE_NAME }}-dist
|
|
129
|
+
path: dist
|
|
130
|
+
|
|
131
|
+
- name: Creating release
|
|
132
|
+
uses: softprops/action-gh-release@2bb465e97f322d3cb2a965294d483e0d26a67aa9 # v3.0.1
|
|
133
|
+
with:
|
|
134
|
+
files: dist/*.whl,dist/*.tar.gz
|
|
135
|
+
make_latest: true
|
|
136
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- "*"
|
|
8
|
+
pull_request:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
- develop
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
code_qa:
|
|
15
|
+
name: Code quality assurance testing
|
|
16
|
+
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Doing checkout
|
|
21
|
+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
22
|
+
|
|
23
|
+
- name: "Setting up Python"
|
|
24
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
25
|
+
with:
|
|
26
|
+
python-version-file: ".python-version"
|
|
27
|
+
|
|
28
|
+
- name: Installing `uv`
|
|
29
|
+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
30
|
+
|
|
31
|
+
- name: Syncing dependencies
|
|
32
|
+
run: uv sync --dev --frozen
|
|
33
|
+
|
|
34
|
+
- name: Validating typing
|
|
35
|
+
run: uv run poe types
|
|
36
|
+
|
|
37
|
+
- name: Validating formatting
|
|
38
|
+
run: uv run poe check
|
|
39
|
+
|
|
40
|
+
- name: Running `pytest` tests
|
|
41
|
+
run: uv run poe tests
|
|
42
|
+
|
|
43
|
+
- name: Uploading coverage reports to Codecov
|
|
44
|
+
uses: codecov/codecov-action@e53489f4d376d79066609109e7a95a29eb3740b1 #v7.0.0
|
|
45
|
+
with:
|
|
46
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
__version__.py
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py.cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# UV
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi
|
|
127
|
+
|
|
128
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
129
|
+
__pypackages__/
|
|
130
|
+
|
|
131
|
+
# Celery stuff
|
|
132
|
+
celerybeat-schedule
|
|
133
|
+
celerybeat.pid
|
|
134
|
+
|
|
135
|
+
# Redis
|
|
136
|
+
*.rdb
|
|
137
|
+
*.aof
|
|
138
|
+
*.pid
|
|
139
|
+
|
|
140
|
+
# RabbitMQ
|
|
141
|
+
mnesia/
|
|
142
|
+
rabbitmq/
|
|
143
|
+
rabbitmq-data/
|
|
144
|
+
|
|
145
|
+
# ActiveMQ
|
|
146
|
+
activemq-data/
|
|
147
|
+
|
|
148
|
+
# SageMath parsed files
|
|
149
|
+
*.sage.py
|
|
150
|
+
|
|
151
|
+
# Environments
|
|
152
|
+
.env
|
|
153
|
+
.envrc
|
|
154
|
+
.venv
|
|
155
|
+
env/
|
|
156
|
+
venv/
|
|
157
|
+
ENV/
|
|
158
|
+
env.bak/
|
|
159
|
+
venv.bak/
|
|
160
|
+
|
|
161
|
+
# Spyder project settings
|
|
162
|
+
.spyderproject
|
|
163
|
+
.spyproject
|
|
164
|
+
|
|
165
|
+
# Rope project settings
|
|
166
|
+
.ropeproject
|
|
167
|
+
|
|
168
|
+
# mkdocs documentation
|
|
169
|
+
/site
|
|
170
|
+
|
|
171
|
+
# mypy
|
|
172
|
+
.mypy_cache/
|
|
173
|
+
.dmypy.json
|
|
174
|
+
dmypy.json
|
|
175
|
+
|
|
176
|
+
# Pyre type checker
|
|
177
|
+
.pyre/
|
|
178
|
+
|
|
179
|
+
# pytype static type analyzer
|
|
180
|
+
.pytype/
|
|
181
|
+
|
|
182
|
+
# Cython debug symbols
|
|
183
|
+
cython_debug/
|
|
184
|
+
|
|
185
|
+
# PyCharm
|
|
186
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
187
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
188
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
189
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
190
|
+
# .idea/
|
|
191
|
+
|
|
192
|
+
# Abstra
|
|
193
|
+
# Abstra is an AI-powered process automation framework.
|
|
194
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
195
|
+
# Learn more at https://abstra.io/docs
|
|
196
|
+
.abstra/
|
|
197
|
+
|
|
198
|
+
# Visual Studio Code
|
|
199
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
200
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
201
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
202
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
203
|
+
# .vscode/
|
|
204
|
+
# Temporary file for partial code execution
|
|
205
|
+
tempCodeRunnerFile.py
|
|
206
|
+
|
|
207
|
+
# Ruff stuff:
|
|
208
|
+
.ruff_cache/
|
|
209
|
+
|
|
210
|
+
# PyPI configuration file
|
|
211
|
+
.pypirc
|
|
212
|
+
|
|
213
|
+
# Marimo
|
|
214
|
+
marimo/_static/
|
|
215
|
+
marimo/_lsp/
|
|
216
|
+
__marimo__/
|
|
217
|
+
|
|
218
|
+
# Streamlit
|
|
219
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14
|
btrcache-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucas Dias
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
btrcache-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: btrcache
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: High-performance caching tools, memoization decorators, and cache collections for Python.
|
|
5
|
+
Project-URL: Homepage, https://github.com/lucas-azdias/btrcache?tab=readme-ov-file
|
|
6
|
+
Project-URL: Source, https://github.com/lucas-azdias/btrcache
|
|
7
|
+
Project-URL: Issues, https://github.com/lucas-azdias/btrcache/issues
|
|
8
|
+
Author-email: Lucas Dias <lucas@azdias.com.br>
|
|
9
|
+
Maintainer-email: Lucas Dias <lucas@azdias.com.br>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.14
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# `btrcache`
|
|
23
|
+
|
|
24
|
+
[](https://raw.github.com/lucas-azdias/btrcache/master/LICENSE)
|
|
25
|
+
|
|
26
|
+
[](https://codecov.io/gh/lucas-azdias/btrcache)
|
|
27
|
+
|
|
28
|
+
High-performance caching tools, memoization decorators, and cache collections for Python.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
**`btrcache`** is a Python library that provides a flexible set of in-memory caching primitives, decorators, and cache collections designed for both synchronous and asynchronous workloads.
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install btrcache
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
<!--
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
### Simple function memoization
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from btrcache import cached
|
|
49
|
+
|
|
50
|
+
@cached()
|
|
51
|
+
def fib(n: int) -> int:
|
|
52
|
+
if n < 2:
|
|
53
|
+
return n
|
|
54
|
+
return fib(n - 1) + fib(n - 2)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Custom cache size
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from btrcache import cached, LRUCache
|
|
61
|
+
|
|
62
|
+
@cached(cache_factory=lambda: LRUCache(maxsize=1024))
|
|
63
|
+
def compute(x):
|
|
64
|
+
return x * x
|
|
65
|
+
```
|
|
66
|
+
-->
|
|
67
|
+
|
|
68
|
+
## Roadmap
|
|
69
|
+
|
|
70
|
+
* [X] Key generators
|
|
71
|
+
* [X] Asynchronous decorators
|
|
72
|
+
* [ ] Create tests
|
|
73
|
+
* [ ] Release in PyPi
|
|
74
|
+
* [ ] Synchronous decorators
|
|
75
|
+
* [ ] Cache collections
|
|
76
|
+
* [ ] Optimizations
|
|
77
|
+
|
|
78
|
+
## Contributing
|
|
79
|
+
|
|
80
|
+
Contributions are welcome. Please ensure:
|
|
81
|
+
|
|
82
|
+
* Code is type-annotated;
|
|
83
|
+
* Tests cover edge cases.
|
|
84
|
+
|
|
85
|
+
## Acknowledgements
|
|
86
|
+
|
|
87
|
+
This project builds upon ideas and implementations from the following open-source projects:
|
|
88
|
+
|
|
89
|
+
- [`cachetools`](https://github.com/tkem/cachetools/) - An extensible set of memoizing collections and decorators for Python. Developed and maintained by [Thomas Kemmer](https://github.com/tkem/).
|
|
90
|
+
- [`cachetools-async`](https://github.com/imnotjames/cachetools-async/) - Python library that extends `cachetools` with async decorators. Created by [James Ward](https://github.com/imnotjames/).
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
Copyright (C) 2026 Lucas Dias.
|
|
95
|
+
|
|
96
|
+
Licensed under the [MIT License](LICENSE).
|
btrcache-0.1.0/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# `btrcache`
|
|
2
|
+
|
|
3
|
+
[](https://raw.github.com/lucas-azdias/btrcache/master/LICENSE)
|
|
4
|
+
|
|
5
|
+
[](https://codecov.io/gh/lucas-azdias/btrcache)
|
|
6
|
+
|
|
7
|
+
High-performance caching tools, memoization decorators, and cache collections for Python.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
**`btrcache`** is a Python library that provides a flexible set of in-memory caching primitives, decorators, and cache collections designed for both synchronous and asynchronous workloads.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install btrcache
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<!--
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### Simple function memoization
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from btrcache import cached
|
|
28
|
+
|
|
29
|
+
@cached()
|
|
30
|
+
def fib(n: int) -> int:
|
|
31
|
+
if n < 2:
|
|
32
|
+
return n
|
|
33
|
+
return fib(n - 1) + fib(n - 2)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Custom cache size
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from btrcache import cached, LRUCache
|
|
40
|
+
|
|
41
|
+
@cached(cache_factory=lambda: LRUCache(maxsize=1024))
|
|
42
|
+
def compute(x):
|
|
43
|
+
return x * x
|
|
44
|
+
```
|
|
45
|
+
-->
|
|
46
|
+
|
|
47
|
+
## Roadmap
|
|
48
|
+
|
|
49
|
+
* [X] Key generators
|
|
50
|
+
* [X] Asynchronous decorators
|
|
51
|
+
* [ ] Create tests
|
|
52
|
+
* [ ] Release in PyPi
|
|
53
|
+
* [ ] Synchronous decorators
|
|
54
|
+
* [ ] Cache collections
|
|
55
|
+
* [ ] Optimizations
|
|
56
|
+
|
|
57
|
+
## Contributing
|
|
58
|
+
|
|
59
|
+
Contributions are welcome. Please ensure:
|
|
60
|
+
|
|
61
|
+
* Code is type-annotated;
|
|
62
|
+
* Tests cover edge cases.
|
|
63
|
+
|
|
64
|
+
## Acknowledgements
|
|
65
|
+
|
|
66
|
+
This project builds upon ideas and implementations from the following open-source projects:
|
|
67
|
+
|
|
68
|
+
- [`cachetools`](https://github.com/tkem/cachetools/) - An extensible set of memoizing collections and decorators for Python. Developed and maintained by [Thomas Kemmer](https://github.com/tkem/).
|
|
69
|
+
- [`cachetools-async`](https://github.com/imnotjames/cachetools-async/) - Python library that extends `cachetools` with async decorators. Created by [James Ward](https://github.com/imnotjames/).
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Copyright (C) 2026 Lucas Dias.
|
|
74
|
+
|
|
75
|
+
Licensed under the [MIT License](LICENSE).
|