readeck 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.
@@ -0,0 +1,176 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
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
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
158
+ # project, it is not recommended to check in the commonly ignored directories such as
159
+ # .idea/ unless you have good reasons to do so.
160
+ .idea/
161
+
162
+ # VS Code
163
+ .vscode/
164
+
165
+ # uv
166
+ .uv/
167
+ uv.lock
168
+
169
+ # macOS
170
+ .DS_Store
171
+
172
+ # Test artifacts
173
+ .pytest_cache/
174
+ htmlcov/
175
+ .coverage
176
+ coverage.xml
readeck-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yash Vanzara
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.
readeck-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: readeck
3
+ Version: 0.1.0
4
+ Summary: Python client library for Readeck APIs
5
+ Project-URL: Homepage, https://github.com/yashvanzara/readeck-python
6
+ Project-URL: Documentation, https://github.com/yashvanzara/readeck-python#readme
7
+ Project-URL: Repository, https://github.com/yashvanzara/readeck-python
8
+ Project-URL: Issues, https://github.com/yashvanzara/readeck-python/issues
9
+ Author-email: Yash Vanzara <yashvanzara@gmail.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: api,bookmark,client,readeck,reader
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Internet :: WWW/HTTP
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: httpx>=0.24.0
25
+ Requires-Dist: pydantic>=2.0.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: black>=23.0.0; extra == 'dev'
28
+ Requires-Dist: flake8>=6.0.0; extra == 'dev'
29
+ Requires-Dist: isort>=5.12.0; extra == 'dev'
30
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
31
+ Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
32
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
33
+ Requires-Dist: pytest-httpx>=0.21.0; extra == 'dev'
34
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Readeck Python Client
38
+
39
+ A Python client library for the Readeck API, providing easy access to Readeck's bookmark and reading features.
40
+
41
+ ## Features
42
+
43
+ - Full async/await support
44
+ - Type hints with Pydantic models
45
+ - Comprehensive error handling
46
+ - Support for Python 3.10+
47
+ - Easy authentication with Bearer tokens
48
+
49
+ ## Installation
50
+
51
+ ```bash
52
+ pip install readeck
53
+ ```
54
+
55
+ ## Quick Start
56
+
57
+ ```python
58
+ import asyncio
59
+ from readeck import ReadeckClient
60
+
61
+ async def main():
62
+ client = ReadeckClient(
63
+ base_url="https://your-readeck-instance.com",
64
+ token="your-bearer-token"
65
+ )
66
+
67
+ # Get user profile
68
+ profile = await client.get_user_profile()
69
+ print(f"Welcome, {profile.user.username}!")
70
+
71
+ # Create a bookmark
72
+ result = await client.create_bookmark(
73
+ url="https://example.com/article",
74
+ title="Interesting Article",
75
+ labels=["reading", "tech"]
76
+ )
77
+ print(f"Bookmark created with ID: {result.bookmark_id}")
78
+
79
+ await client.close()
80
+
81
+ if __name__ == "__main__":
82
+ asyncio.run(main())
83
+ ```
84
+
85
+ ## Authentication
86
+
87
+ The client uses Bearer token authentication. You can obtain your token from your Readeck instance's settings.
88
+
89
+ ```python
90
+ client = ReadeckClient(
91
+ base_url="https://your-readeck-instance.com",
92
+ token="your-bearer-token"
93
+ )
94
+ ```
95
+
96
+ ## API Reference
97
+
98
+ ### User Profile
99
+
100
+ Get the current user's profile information:
101
+
102
+ ```python
103
+ profile = await client.get_user_profile()
104
+ ```
105
+
106
+ Returns a `UserProfile` object containing:
107
+ - User information (username, email, creation date)
108
+ - Authentication provider details
109
+ - User settings and preferences
110
+ - Reader settings (font, font size, line height)
111
+
112
+ ### Bookmarks
113
+
114
+ #### Create Bookmark
115
+
116
+ Create a new bookmark:
117
+
118
+ ```python
119
+ # Minimal bookmark
120
+ result = await client.create_bookmark(url="https://example.com")
121
+
122
+ # Bookmark with title
123
+ result = await client.create_bookmark(
124
+ url="https://example.com/article",
125
+ title="Article Title"
126
+ )
127
+
128
+ # Bookmark with labels
129
+ result = await client.create_bookmark(
130
+ url="https://example.com/tutorial",
131
+ labels=["tutorial", "programming"]
132
+ )
133
+
134
+ # Complete bookmark
135
+ result = await client.create_bookmark(
136
+ url="https://example.com/complete",
137
+ title="Complete Example",
138
+ labels=["example", "complete", "demo"]
139
+ )
140
+ ```
141
+
142
+ The `create_bookmark` method returns a `BookmarkCreateResult` object containing:
143
+ - `response`: The API response with message and status
144
+ - `bookmark_id`: The ID of the created bookmark (from response headers)
145
+ - `location`: The URL of the created resource (from response headers)
146
+
147
+ #### Get Bookmarks
148
+
149
+ Retrieve bookmarks with optional filtering:
150
+
151
+ ```python
152
+ # Get all bookmarks
153
+ bookmarks = await client.get_bookmarks()
154
+
155
+ # Get bookmarks with parameters
156
+ from readeck import BookmarkListParams
157
+
158
+ params = BookmarkListParams(
159
+ limit=10,
160
+ search="python",
161
+ labels="programming"
162
+ )
163
+ bookmarks = await client.get_bookmarks(params)
164
+ ```
165
+
166
+ ## Development
167
+
168
+ This project uses `uv` for dependency management:
169
+
170
+ ```bash
171
+ # Install dependencies
172
+ uv sync --dev
173
+
174
+ # Run tests
175
+ uv run pytest
176
+
177
+ # Run linting
178
+ uv run black src tests
179
+ uv run isort src tests
180
+ uv run flake8 src tests
181
+ uv run mypy src
182
+
183
+ # Run all checks
184
+ uv run pre-commit run --all-files
185
+ ```
186
+
187
+ ## License
188
+
189
+ MIT License. See [LICENSE](LICENSE) for details.
190
+
191
+ ## Contributing
192
+
193
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,157 @@
1
+ # Readeck Python Client
2
+
3
+ A Python client library for the Readeck API, providing easy access to Readeck's bookmark and reading features.
4
+
5
+ ## Features
6
+
7
+ - Full async/await support
8
+ - Type hints with Pydantic models
9
+ - Comprehensive error handling
10
+ - Support for Python 3.10+
11
+ - Easy authentication with Bearer tokens
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install readeck
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```python
22
+ import asyncio
23
+ from readeck import ReadeckClient
24
+
25
+ async def main():
26
+ client = ReadeckClient(
27
+ base_url="https://your-readeck-instance.com",
28
+ token="your-bearer-token"
29
+ )
30
+
31
+ # Get user profile
32
+ profile = await client.get_user_profile()
33
+ print(f"Welcome, {profile.user.username}!")
34
+
35
+ # Create a bookmark
36
+ result = await client.create_bookmark(
37
+ url="https://example.com/article",
38
+ title="Interesting Article",
39
+ labels=["reading", "tech"]
40
+ )
41
+ print(f"Bookmark created with ID: {result.bookmark_id}")
42
+
43
+ await client.close()
44
+
45
+ if __name__ == "__main__":
46
+ asyncio.run(main())
47
+ ```
48
+
49
+ ## Authentication
50
+
51
+ The client uses Bearer token authentication. You can obtain your token from your Readeck instance's settings.
52
+
53
+ ```python
54
+ client = ReadeckClient(
55
+ base_url="https://your-readeck-instance.com",
56
+ token="your-bearer-token"
57
+ )
58
+ ```
59
+
60
+ ## API Reference
61
+
62
+ ### User Profile
63
+
64
+ Get the current user's profile information:
65
+
66
+ ```python
67
+ profile = await client.get_user_profile()
68
+ ```
69
+
70
+ Returns a `UserProfile` object containing:
71
+ - User information (username, email, creation date)
72
+ - Authentication provider details
73
+ - User settings and preferences
74
+ - Reader settings (font, font size, line height)
75
+
76
+ ### Bookmarks
77
+
78
+ #### Create Bookmark
79
+
80
+ Create a new bookmark:
81
+
82
+ ```python
83
+ # Minimal bookmark
84
+ result = await client.create_bookmark(url="https://example.com")
85
+
86
+ # Bookmark with title
87
+ result = await client.create_bookmark(
88
+ url="https://example.com/article",
89
+ title="Article Title"
90
+ )
91
+
92
+ # Bookmark with labels
93
+ result = await client.create_bookmark(
94
+ url="https://example.com/tutorial",
95
+ labels=["tutorial", "programming"]
96
+ )
97
+
98
+ # Complete bookmark
99
+ result = await client.create_bookmark(
100
+ url="https://example.com/complete",
101
+ title="Complete Example",
102
+ labels=["example", "complete", "demo"]
103
+ )
104
+ ```
105
+
106
+ The `create_bookmark` method returns a `BookmarkCreateResult` object containing:
107
+ - `response`: The API response with message and status
108
+ - `bookmark_id`: The ID of the created bookmark (from response headers)
109
+ - `location`: The URL of the created resource (from response headers)
110
+
111
+ #### Get Bookmarks
112
+
113
+ Retrieve bookmarks with optional filtering:
114
+
115
+ ```python
116
+ # Get all bookmarks
117
+ bookmarks = await client.get_bookmarks()
118
+
119
+ # Get bookmarks with parameters
120
+ from readeck import BookmarkListParams
121
+
122
+ params = BookmarkListParams(
123
+ limit=10,
124
+ search="python",
125
+ labels="programming"
126
+ )
127
+ bookmarks = await client.get_bookmarks(params)
128
+ ```
129
+
130
+ ## Development
131
+
132
+ This project uses `uv` for dependency management:
133
+
134
+ ```bash
135
+ # Install dependencies
136
+ uv sync --dev
137
+
138
+ # Run tests
139
+ uv run pytest
140
+
141
+ # Run linting
142
+ uv run black src tests
143
+ uv run isort src tests
144
+ uv run flake8 src tests
145
+ uv run mypy src
146
+
147
+ # Run all checks
148
+ uv run pre-commit run --all-files
149
+ ```
150
+
151
+ ## License
152
+
153
+ MIT License. See [LICENSE](LICENSE) for details.
154
+
155
+ ## Contributing
156
+
157
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,150 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "readeck"
7
+ dynamic = ["version"]
8
+ description = "Python client library for Readeck APIs"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ { name = "Yash Vanzara", email = "yashvanzara@gmail.com" },
14
+ ]
15
+ keywords = ["readeck", "api", "client", "bookmark", "reader"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Topic :: Internet :: WWW/HTTP",
26
+ "Topic :: Software Development :: Libraries :: Python Modules",
27
+ ]
28
+ dependencies = [
29
+ "httpx>=0.24.0",
30
+ "pydantic>=2.0.0",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ dev = [
35
+ "pytest>=7.0.0",
36
+ "pytest-cov>=4.0.0",
37
+ "pytest-httpx>=0.21.0",
38
+ "black>=23.0.0",
39
+ "isort>=5.12.0",
40
+ "flake8>=6.0.0",
41
+ "mypy>=1.0.0",
42
+ "pre-commit>=3.0.0",
43
+ ]
44
+
45
+ [project.urls]
46
+ Homepage = "https://github.com/yashvanzara/readeck-python"
47
+ Documentation = "https://github.com/yashvanzara/readeck-python#readme"
48
+ Repository = "https://github.com/yashvanzara/readeck-python"
49
+ Issues = "https://github.com/yashvanzara/readeck-python/issues"
50
+
51
+ [tool.hatch.version]
52
+ path = "src/readeck/__init__.py"
53
+
54
+ [tool.hatch.build.targets.sdist]
55
+ include = [
56
+ "/src",
57
+ ]
58
+
59
+ [tool.hatch.build.targets.wheel]
60
+ packages = ["src/readeck"]
61
+
62
+ [tool.black]
63
+ line-length = 88
64
+ target-version = ['py310']
65
+ include = '\.pyi?$'
66
+ extend-exclude = '''
67
+ /(
68
+ # directories
69
+ \.eggs
70
+ | \.git
71
+ | \.hg
72
+ | \.mypy_cache
73
+ | \.tox
74
+ | \.venv
75
+ | build
76
+ | dist
77
+ )/
78
+ '''
79
+
80
+ [tool.isort]
81
+ profile = "black"
82
+ multi_line_output = 3
83
+ line_length = 88
84
+ include_trailing_comma = true
85
+ force_grid_wrap = 0
86
+ use_parentheses = true
87
+ ensure_newline_before_comments = true
88
+
89
+ [tool.mypy]
90
+ python_version = "3.10"
91
+ warn_return_any = true
92
+ warn_unused_configs = true
93
+ disallow_untyped_defs = true
94
+ disallow_incomplete_defs = true
95
+ check_untyped_defs = true
96
+ disallow_untyped_decorators = true
97
+ no_implicit_optional = true
98
+ warn_redundant_casts = true
99
+ warn_unused_ignores = true
100
+ warn_no_return = true
101
+ warn_unreachable = true
102
+ strict_equality = true
103
+
104
+ [[tool.mypy.overrides]]
105
+ module = "tests.*"
106
+ disallow_untyped_defs = false
107
+
108
+ [tool.pytest.ini_options]
109
+ testpaths = ["tests"]
110
+ python_files = ["test_*.py", "*_test.py"]
111
+ python_classes = ["Test*"]
112
+ python_functions = ["test_*"]
113
+ asyncio_default_fixture_loop_scope = "function"
114
+ asyncio_mode = "auto"
115
+ addopts = [
116
+ "--cov=src/readeck",
117
+ "--cov-report=term-missing",
118
+ "--cov-report=html",
119
+ "--cov-fail-under=80",
120
+ ]
121
+
122
+ [tool.coverage.run]
123
+ source = ["src"]
124
+ omit = ["*/tests/*"]
125
+
126
+ [tool.coverage.report]
127
+ exclude_lines = [
128
+ "pragma: no cover",
129
+ "def __repr__",
130
+ "raise AssertionError",
131
+ "raise NotImplementedError",
132
+ "if __name__ == .__main__.:",
133
+ ]
134
+
135
+ [dependency-groups]
136
+ dev = [
137
+ "black>=24.8.0",
138
+ "flake8>=7.1.2",
139
+ "isort>=5.13.2",
140
+ "mypy>=1.14.1",
141
+ "pre-commit>=3.5.0",
142
+ "pytest>=7.4.4",
143
+ "pytest-asyncio>=0.23.8",
144
+ "pytest-cov>=5.0.0",
145
+ "pytest-httpx>=0.22.0",
146
+ "twine>=6.1.0",
147
+ ]
148
+
149
+ [tool.flake8]
150
+ ignore = ["E231"]