Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<p align="center"><img src="https://github.com/user-attachments/assets/d28934e1-a1ab-4b6e-9d12-d64067a65a60"><br>Python SDK and Command-Line Utility for <a href="https://searchcode.com">Searchcode</a>.<br><i>Search 75 billion lines of code from 40 million projects</i></p>
<p align="center"></p>

---

```commandline
searchcode --help
```
Expand All @@ -17,8 +15,6 @@ for result in search.results:
print(result)
```

---

## Installation

```bash
Expand Down Expand Up @@ -56,6 +52,12 @@ Queries the code index and returns at most 100 results.

### Code Search Without Filters

#### CLI

```commandline
searchcode test
```

#### SDK

```python
Expand All @@ -68,16 +70,16 @@ for result in search.results:
print(result)
```

#### CLI

```commandline
searchcode test
```

---

### Filter by Language (Java and JavaScript)

#### CLI

````commandline
searchcode test --languages java,javascript
````

#### SDK

```python
Expand All @@ -90,16 +92,16 @@ for result in search.results:
print(result.language)
```

#### CLI

````commandline
searchcode test --languages java,javascript
````

___

### Filter by Source (BitBucket and CodePlex)

#### CLI

```commandline
searchcode test --sources bitbucket,codeplex
```

#### SDK

```python
Expand All @@ -112,16 +114,16 @@ for result in search.results:
print(result.filename)
```

___

### Filter by Lines of Code (Between 500 and 1000)

#### CLI

```commandline
searchcode test --sources bitbucket,codeplex
searchcode test --lines-of-code-gt 500 --lines-of-code-lt 1000
```

___

### Filter by Lines of Code (Between 500 and 1000)

#### SDK

```python
Expand All @@ -135,16 +137,16 @@ for result in search.results:
print(result)
```

___

### With Callback Function (JSONP only)

#### CLI

```commandline
searchcode test --lines-of-code-gt 500 --lines-of-code-lt 1000
searchcode test --callback myCallback
```

___

### With Callback Function (JSONP only)

#### SDK

```python
Expand All @@ -155,11 +157,7 @@ search = sc.search(query="test", callback="myCallback")
print(search)
```

#### CLI

```commandline
searchcode test --callback myCallback
```
`

### Response Attribute Definitions

Expand Down Expand Up @@ -198,6 +196,12 @@ ___

Returns the raw data from a code file given the code id which can be found as the `id` in a code search result.

#### CLI

```commandline
searchode code 4061576
```

#### SDK

#### Params
Expand All @@ -213,11 +217,7 @@ code = sc.code(4061576)
print(code)
```

#### CLI

```commandline
searchode code 4061576
```
---

## About Searchcode

Expand Down