Skip to content

Commit ca3489d

Browse files
author
Sam
committed
support serp endpoint, add more helper functions and refactor: update API key handling and improve error messages
1 parent dddc519 commit ca3489d

24 files changed

Lines changed: 1416 additions & 1343 deletions

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* Ujeebu Python version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

.gitignore

Lines changed: 99 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ parts/
2121
sdist/
2222
var/
2323
wheels/
24+
pip-wheel-metadata/
25+
share/python-wheels/
2426
*.egg-info/
2527
.installed.cfg
2628
*.egg
29+
MANIFEST
2730

2831
# PyInstaller
2932
# Usually these files are written by a python script from a template
@@ -44,8 +47,10 @@ htmlcov/
4447
nosetests.xml
4548
coverage.xml
4649
*.cover
50+
*.py,cover
4751
.hypothesis/
4852
.pytest_cache/
53+
.ruff_cache/
4954

5055
# Translations
5156
*.mo
@@ -54,6 +59,8 @@ coverage.xml
5459
# Django stuff:
5560
*.log
5661
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
5764

5865
# Flask stuff:
5966
instance/
@@ -64,29 +71,49 @@ instance/
6471

6572
# Sphinx documentation
6673
docs/_build/
74+
docs/_static/
75+
docs/_templates/
6776

6877
# PyBuilder
6978
target/
79+
.pybuilder/
7080

7181
# Jupyter Notebook
7282
.ipynb_checkpoints
7383

84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
7488
# pyenv
7589
.python-version
7690

91+
# pipenv
92+
Pipfile.lock
93+
94+
# Poetry
95+
poetry.lock
96+
7797
# celery beat schedule file
7898
celerybeat-schedule
99+
celerybeat.pid
79100

80101
# SageMath parsed files
81102
*.sage.py
82103

83-
# dotenv
104+
# Environments
84105
.env
85-
86-
# virtualenv
106+
.env.local
107+
.env.*.local
87108
.venv
88109
venv/
89110
ENV/
111+
env.bak/
112+
venv.bak/
113+
114+
# virtualenv
115+
.Python
116+
pyvenv.cfg
90117

91118
# Spyder project settings
92119
.spyderproject
@@ -100,9 +127,77 @@ ENV/
100127

101128
# mypy
102129
.mypy_cache/
130+
.dmypy.json
131+
dmypy.json
132+
133+
# Pyre type checker
134+
.pyre/
135+
136+
# pytype static type analyzer
137+
.pytype/
103138

104139
# IDE settings
105140
.vscode/
106141
.idea/
142+
*.swp
143+
*.swo
144+
*~
145+
.project
146+
.pydevproject
147+
.settings/
148+
149+
# OS specific files
150+
.DS_Store
151+
.DS_Store?
152+
._*
153+
.Spotlight-V100
154+
.Trashes
155+
ehthumbs.db
156+
Thumbs.db
157+
Desktop.ini
158+
159+
# Claude Code
160+
.claude/
161+
CLAUDE.md
162+
163+
# Junie
164+
.junie/
165+
166+
# Project specific
167+
/rd/
168+
169+
# Generated example outputs
170+
examples/screenshot.png
171+
examples/screenshot_test.png
172+
examples/screenshot.jpg
173+
examples/*.pdf
174+
examples/*.html
175+
!examples/page.html
176+
177+
# Test outputs and scripts
178+
test_output.log
179+
test_output.txt
180+
quick_test.py
181+
run_validation.py
182+
test_examples.py
183+
run_tests.sh
184+
185+
# Temporary/internal markdown files
186+
API_KEY_REMOVAL_COMPLETE.md
187+
EXAMPLES_SUMMARY.md
188+
RUNNING_EXAMPLES.md
189+
SECURITY_UPDATE.md
190+
VALIDATION_REPORT.md
191+
192+
# Backup files
193+
*.bak
194+
*.tmp
195+
*.temp
196+
197+
# PyPI distribution files (regenerated during build)
198+
dist/
199+
200+
# Coverage reports
201+
.coverage
202+
/tmp
107203

108-
docs

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Config file for automatic testing at travis-ci.com
2+
3+
language: python
4+
python:
5+
- "3.12"
6+
- "3.11"
7+
- "3.10"
8+
- "3.9"
9+
- "3.8"
10+
11+
# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
12+
install: pip install -U tox-travis
13+
14+
# Command to run tests, e.g. python setup.py test
15+
script: tox
16+
17+
# Assuming you have installed the travis-ci CLI tool, after you
18+
# create the Github repo and add it to Travis, run the
19+
# following command to finish PyPI deployment setup:
20+
# $ travis encrypt --add deploy.password
21+
deploy:
22+
provider: pypi
23+
distributions: sdist bdist_wheel
24+
user: ujeebu
25+
password:
26+
secure: PLEASE_REPLACE_ME
27+
on:
28+
tags: true
29+
repo: ujeebu/ujeebu-python
30+
python: "3.12"

AUTHORS.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Development Lead
6+
----------------
7+
8+
* Ujeebu <support@ujeebu.com>
9+
* Yacine Alhyane <y.alhyane@gmail.com>
10+
11+
Contributors
12+
------------
13+
14+
None yet. Why not be the first?

CONTRIBUTING.rst

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
.. highlight:: shell
2+
3+
============
4+
Contributing
5+
============
6+
7+
Contributions are welcome, and they are greatly appreciated! Every little bit
8+
helps, and credit will always be given.
9+
10+
You can contribute in many ways:
11+
12+
Types of Contributions
13+
----------------------
14+
15+
Report Bugs
16+
~~~~~~~~~~~
17+
18+
Report bugs at https://github.com/ujeebu/ujeebu-python/issues.
19+
20+
If you are reporting a bug, please include:
21+
22+
* Your operating system name and version.
23+
* Any details about your local setup that might be helpful in troubleshooting.
24+
* Detailed steps to reproduce the bug.
25+
26+
Fix Bugs
27+
~~~~~~~~
28+
29+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30+
wanted" is open to whoever wants to implement it.
31+
32+
Implement Features
33+
~~~~~~~~~~~~~~~~~~
34+
35+
Look through the GitHub issues for features. Anything tagged with "enhancement"
36+
and "help wanted" is open to whoever wants to implement it.
37+
38+
Write Documentation
39+
~~~~~~~~~~~~~~~~~~~
40+
41+
Ujeebu Python could always use more documentation, whether as part of the
42+
official Ujeebu Python docs, in docstrings, or even on the web in blog posts,
43+
articles, and such.
44+
45+
Submit Feedback
46+
~~~~~~~~~~~~~~~
47+
48+
The best way to send feedback is to file an issue at https://github.com/ujeebu/ujeebu-python/issues.
49+
50+
If you are proposing a feature:
51+
52+
* Explain in detail how it would work.
53+
* Keep the scope as narrow as possible, to make it easier to implement.
54+
* Remember that this is a volunteer-driven project, and that contributions
55+
are welcome :)
56+
57+
Get Started!
58+
------------
59+
60+
Ready to contribute? Here's how to set up `ujeebu_python` for local development.
61+
62+
1. Fork the `ujeebu_python` repo on GitHub.
63+
2. Clone your fork locally::
64+
65+
$ git clone git@github.com:your_name_here/ujeebu_python.git
66+
67+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68+
69+
$ mkvirtualenv ujeebu_python
70+
$ cd ujeebu_python/
71+
$ python setup.py develop
72+
73+
4. Create a branch for local development::
74+
75+
$ git checkout -b name-of-your-bugfix-or-feature
76+
77+
Now you can make your changes locally.
78+
79+
5. When you're done making changes, check that your changes pass flake8 and the
80+
tests, including testing other Python versions with tox::
81+
82+
$ flake8 ujeebu_python tests
83+
$ python setup.py test or pytest
84+
$ tox
85+
86+
To get flake8 and tox, just pip install them into your virtualenv.
87+
88+
6. Commit your changes and push your branch to GitHub::
89+
90+
$ git add .
91+
$ git commit -m "Your detailed description of your changes."
92+
$ git push origin name-of-your-bugfix-or-feature
93+
94+
7. Submit a pull request through the GitHub website.
95+
96+
Pull Request Guidelines
97+
-----------------------
98+
99+
Before you submit a pull request, check that it meets these guidelines:
100+
101+
1. The pull request should include tests.
102+
2. If the pull request adds functionality, the docs should be updated. Put
103+
your new functionality into a function with a docstring, and add the
104+
feature to the list in README.rst.
105+
3. The pull request should work for Python 3.8, 3.9, 3.10, 3.11, and 3.12. Check
106+
https://github.com/ujeebu/ujeebu-python/actions
107+
and make sure that the tests pass for all supported Python versions.
108+
109+
Tips
110+
----
111+
112+
To run a subset of tests::
113+
114+
115+
$ python -m unittest tests.test_ujeebu_python
116+
117+
Deploying
118+
---------
119+
120+
A reminder for the maintainers on how to deploy.
121+
Make sure all your changes are committed (including an entry in HISTORY.rst).
122+
Then run::
123+
124+
$ bump2version patch # possible: major / minor / patch
125+
$ git push
126+
$ git push --tags
127+
128+
Travis will then deploy to PyPI if tests pass.

HISTORY.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=======
2+
History
3+
=======
4+
5+
0.1.1-beta (2025-12-21)
6+
-----------------------
7+
8+
* Added helper methods for scrape API (get_pdf, get_screenshot, get_html, scrape_with_rules).
9+
* Added SERP API helper methods (search_text, search_news, search_images).
10+
* Added account endpoint to retrieve account information.
11+
* Improved error handling and response processing.
12+
* Updated Python version support (3.8+).
13+

0 commit comments

Comments
 (0)