Skip to content

Commit 1d55cff

Browse files
authored
Bump version: 0.5.1 -> 0.6 (#36)
2 parents e7cd59a + 3f05387 commit 1d55cff

11 files changed

Lines changed: 482 additions & 364 deletions

File tree

README.md

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<p align="center"><img src="https://searchcode.com/static/searchcode_logo.png" width=300 height=60><br>Python SDK and CLI utility for <a href="https://searchcode.com">Searchcode</a>.<br><i>Simple, comprehensive code search.</i></p>
1+
<p align="center">
2+
<img src="https://searchcode.com/static/searchcode_logo.png" width=300><br><strong>Searchcode SDK</strong>: Python library and CLI utility for <a href="https://searchcode.com">Searchcode</a>.<br><i>Simple, comprehensive code search.</i></p>
23
<p align="center"></p>
34

4-
---
5-
65
```commandline
76
searchcode search "import module"
87
```
@@ -15,7 +14,7 @@ sc search "import module"
1514

1615
```python
1716
from pprint import pprint
18-
from src.searchcode import Searchcode
17+
from searchcode import Searchcode
1918

2019
sc = Searchcode(user_agent="My-Searchcode-script")
2120
search = sc.search(query="import module")
@@ -44,7 +43,7 @@ searchcode "import module"
4443

4544
```python
4645
from pprint import pprint
47-
from src.searchcode import Searchcode
46+
from searchcode import Searchcode
4847

4948
sc = Searchcode(user_agent="My-Searchcode-script")
5049
search = sc.search(query="import module")
@@ -66,7 +65,7 @@ searchcode "import module" --languages java,javascript
6665

6766
```python
6867
from pprint import pprint
69-
from src.searchcode import Searchcode
68+
from searchcode import Searchcode
7069

7170
sc = Searchcode(user_agent="My-Searchcode-script")
7271
search = sc.search(query="import module", languages=["Java", "JavaScript"])
@@ -89,7 +88,7 @@ searchcode "import module" --sources bitbucket,codeplex
8988

9089
```python
9190
from pprint import pprint
92-
from src.searchcode import Searchcode
91+
from searchcode import Searchcode
9392

9493
sc = Searchcode(user_agent="My-Searchcode-script")
9594
search = sc.search(query="import module", sources=["BitBucket", "CodePlex"])
@@ -112,7 +111,7 @@ searchcode "import module" --lines-of-code-gt 500 --lines-of-code-lt 1000
112111

113112
```python
114113
from pprint import pprint
115-
from src.searchcode import Searchcode
114+
from searchcode import Searchcode
116115

117116
sc = Searchcode(user_agent="My-Searchcode-script")
118117
search = sc.search(query="import module", lines_of_code_gt=500, lines_of_code_lt=1000)
@@ -135,7 +134,7 @@ searchcode "import module" --callback myCallback
135134

136135
```python
137136
from pprint import pprint
138-
from src.searchcode import Searchcode
137+
from searchcode import Searchcode
139138

140139
sc = Searchcode(user_agent="My-Searchcode-script")
141140
search = sc.search(query="import module", callback="myCallback")
@@ -163,39 +162,6 @@ pprint(search)
163162
164163
> To fetch all results for a given query, keep incrementing `page` parameter until you get a page with an empty results
165164
> list.
166-
---
167-
168-
### Response Attribute Definitions
169-
170-
| Attribute | Description |
171-
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
172-
| **searchterm** | Search term supplied to the API through the use of the `q` parameter. |
173-
| **query** | Identical to `searchterm` and included for historical reasons to maintain backward compatibility. |
174-
| **matchterm** | Identical to `searchterm` and included for historical reasons to maintain backward compatibility. |
175-
| **page** | ID of the current page that the query has returned. This is a zero-based index. |
176-
| **nextpage** | ID of the offset of the next page. Always set to the current page + 1, even if you have reached the end of the results. This is a zero-based index. |
177-
| **previouspage** | ID of the offset of the previous page. If no previous page is available, it will be set to `null`. This is a zero-based index. |
178-
| **total** | The total number of results that match the `searchterm` in the index. Note that this value is approximate. It becomes more accurate as you go deeper into the results or use more filters. |
179-
| **language_filters** | Returns an array containing languages that exist in the result set. |
180-
| **id** | Unique ID for this language used by searchcode, which can be used in other API calls. |
181-
| **count** | Total number of results that are written in this language. |
182-
| **language** | The name of this language. |
183-
| **source_filters** | Returns an array containing sources that exist in the result set. |
184-
| **id** | Unique ID for this source used by searchcode, which can be used in other API calls. |
185-
| **count** | Total number of results that belong to this source. |
186-
| **source** | The name of this source. |
187-
| **results** | Returns an array containing the matching code results. |
188-
| **id** | Unique ID for this code result used by searchcode, which can be used in other API calls. |
189-
| **filename** | The filename for this file. |
190-
| **repo** | HTML link to the location of the repository where this code was found. |
191-
| **linescount** | Total number of lines in the matching file. |
192-
| **location** | Location inside the repository where this file exists. |
193-
| **name** | Name of the repository that this file belongs to. |
194-
| **language** | The identified language of this result. |
195-
| **url** | URL to searchcode's location of the file. |
196-
| **md5hash** | Calculated MD5 hash of the file's contents. |
197-
| **lines** | Contains line numbers and lines which match the `searchterm`. Lines immediately before and after the match are included. If only the filename matches, up to the first 15 lines of the file are returned. |
198-
199165
___
200166

201167
### Code Result
@@ -216,7 +182,7 @@ searchode code 4061576
216182

217183
```python
218184

219-
from src.searchcode import Searchcode
185+
from searchcode import Searchcode
220186

221187
sc = Searchcode(user_agent="My-Searchcode-script")
222188
data = sc.code(4061576)

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "searchcode"
3-
version = "0.5.1"
3+
version = "0.6.0"
44
description = "Simple, comprehensive code search."
55
authors = ["Ritchie Mwewa <rly0nheart@duck.com>"]
66
license = "GPLv3+"
@@ -16,6 +16,10 @@ classifiers = [
1616
"Natural Language :: English"
1717
]
1818

19+
20+
packages = [
21+
{ include = "searchcode", from = "src" }
22+
]
1923
[tool.poetry.dependencies]
2024
python = "^3.10"
2125
requests = "^2.32.2"
@@ -30,5 +34,5 @@ requires = ["poetry-core"]
3034
build-backend = "poetry.core.masonry.api"
3135

3236
[tool.poetry.scripts]
33-
sc = "searchcode.__app:cli"
34-
searchcode = "searchcode.__app:cli"
37+
sc = "searchcode._cli.app:cli"
38+
searchcode = "searchcode._cli.app:cli"

src/searchcode/__app.py

Lines changed: 0 additions & 184 deletions
This file was deleted.

src/searchcode/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
from .api import Searchcode
2121

2222
__pkg__ = "searchcode"
23-
__version__ = "0.5.1"
23+
__version__ = "0.6.0"
2424
__author__ = "Ritchie Mwewa"
2525

26+
__all__ = ["Searchcode"]
27+
2628

2729
class License:
2830
terms_and_conditions: str = """

0 commit comments

Comments
 (0)