Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,7 @@ dmypy.json
### Python Patch ###
.venv/

# macOS
.DS_Store

# End of https://www.gitignore.io/api/python
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Python Apicalypse Client

Apicalypse is a simple query language that allows you to easily GET data from API’s. The query can be attached to any GET request as a URL parameter or in the body of the request.

This is the Python client to use the IGDB v3 API.
8 changes: 4 additions & 4 deletions apicalypse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def search(self, search):
def filter(self, filters):
if filters:
if isinstance(filters, list):
self.filter_array.append(f'filter {" & ".join(filters)}')
self.filter_array.append(f'where {" & ".join(filters)}')
else:
self.filter_array.append(f'filter {filters.strip()}')
self.filter_array.append(f'where {filters.strip()}')
return self

def construct_options(self, url):
Expand Down Expand Up @@ -71,7 +71,7 @@ def request(self, url):
return response.json()

def main():
url = 'https://endpoint-alpha.igdb.com/games/'
url = 'https://api-v3.igdb.com/games/'
igdb = apicalypse({
'headers': {
'Accept': 'application/json',
Expand All @@ -83,4 +83,4 @@ def main():
print(igdb.request(url))

if __name__ == "__main__":
main()
main()