Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit f890d54

Browse files
committed
re
1 parent 5fe525f commit f890d54

File tree

3 files changed

+101
-13
lines changed

3 files changed

+101
-13
lines changed

PYPI.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
==============
2+
cod-python-api
3+
==============
4+
**Call Of Duty API Library** for **python** with the implementation of both public and private API used by activision on
5+
callofduty.com
6+
7+
Devs
8+
====
9+
[Todo Lodo](https://github.com/TodoLodo2089) and [Engineer15](https://github.com/Engineer152)
10+
11+
Documentation
12+
=============
13+
This package can be used directly as a python file or as a python library.
14+
15+
Installation
16+
------------
17+
18+
For direct use:
19+
20+
.. code-block:: bash
21+
22+
git clone https://github.com/TodoLodo2089/cod-python-api.git
23+
24+
As a python library using `pip`_:
25+
26+
.. code-block:: bash
27+
28+
pip install -U cod-api
29+
30+
.. _pip: https://pip.pypa.io/en/stable/getting-started/
31+
32+
Usage
33+
=====
34+
35+
Initiation
36+
----------
37+
38+
Import module with its classes:
39+
40+
.. code-block:: python
41+
42+
from cod_api import API
43+
44+
api = API()
45+
46+
47+
Login with your sso token
48+
49+
.. code-block:: python
50+
51+
api.login('Your sso token')
52+
53+
You sso token can be found by longing in at `callofduty`_, opening dev tools (ctr+shift+I),
54+
going to Applications > Storage > Cookies > https://callofduty.com, filter to search 'ACT_SSO_COOKIE' and
55+
copy the value
56+
57+
.. _callofduty: https://my.callofduty.com/
58+
59+
Retrieving game profile
60+
-----------------------
61+
A player's game profile can be retrieved by using API sub game classes with its function fullData(platform, gamertag)
62+
63+
*Example*:
64+
65+
.. code-block:: python
66+
67+
from API import platforms
68+
69+
profileData = api.ModernWarfare.fullData(platforms.Battlenet, "Username#1234")
70+
71+
*Output* > json
72+
73+
Retrieving combat history
74+
-------------------------
75+
A player's game profile can be retrieved by using API sub game classes with its functions combatHistory(platform, gamertag) or
76+
combatHistoryWithDate(platform, gamertag, start, end)
77+
78+
*Example*:
79+
80+
.. code-block:: python
81+
82+
matchHistory = api.Warzone.combatHistory(platforms.Activision, "Username#123456")
83+
84+
*Output* > json

setup.cfg

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
[metadata]
22
description-file = README.md
3-
version
3+
version = attr: cod_api.__version__
4+
project_urls =
5+
Source Code = https://github.com/TodoLodo2089/cod-python-api
6+
Issue Tracker = https://github.com/TodoLodo2089/cod-python-api/issues
7+
license = GPL-3.0
8+
author = Todo Lodo
9+
author_email = [email protected]
10+
maintainer = Engineer15
11+
maintainer_email = [email protected]
12+
description = Call Of Duty API.
13+
long_description = file: PYPI.rst
14+
long_description_content_type = text/x-rst
15+
classifiers =
16+
Intended Audience :: Developers
17+
Operating System :: OS Independent
18+
Programming Language :: Python

setup.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
from setuptools import setup
22

3-
with open("README.rst", "r") as readme_file:
4-
readme = readme_file.read()
5-
63
requirements = ["asyncio", "requests", "uuid", "urllib3", "enum34"]
74

85
setup(
96
name="cod_api",
10-
author="Todo Lodo",
11-
author_email="[email protected]",
12-
maintainer="Engineer15",
13-
maintainer_email="[email protected]",
14-
description="Call Of Duty API",
15-
long_description=readme,
16-
long_description_content_type="text/markdown",
177
packages=['cod_api'],
18-
install_requires=requirements,
19-
classifiers=[],
8+
install_requires=requirements
209
)

0 commit comments

Comments
 (0)