Metadata-Version: 2.1
Name: campfire-basic
Version: 1.0.0
Summary: Campfire API basic functions
Author-email: Camper-CoolDie <campercooldie@gmail.com>
License: MIT License        
        Copyright (c) 2022 theCoolDie        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.        
Project-URL: Homepage, https://github.com/Camper-CoolDie/campfire-basic
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: notifications
Requires-Dist: cryptography (>=3.1) ; extra == 'notifications'
Requires-Dist: oscrypto ; extra == 'notifications'
Requires-Dist: http-ece ; extra == 'notifications'
Requires-Dist: protobuf ; extra == 'notifications'

This module includes several basic functions for sending
and receiving data from Campfire server. It can also
receive push notifications.

# Examples

## Requesting

```py
import campfire

print(campfire.send("RProjectVersionGet"))
# {'ABParams': {}, 'version': '1.290'}
```

This code getting current version of Campfire.

## Log in

A lot of requests will raise exception if user is not
logged in.

```py
import campfire

req = {
    "fandomId": 10,
    "languageId": 1
}

print(campfire.send("RFandomsGet", req))
# ApiRequestException: Error occurred while processing request ("ERROR_UNAUTHORIZED")

log = campfire.login("email", "password")

print(log.send("RFandomsGet", req))
# {'fandom': {'subscribesCount': 1105, 'imageId'...
```

## Receiving notifications

You can receive all notifications Campfire server sending
to you.

```py
import campfire

log = campfire.login("email", "password")

# Generating FCM token
ntoken = campfire.ntoken()

# Sending token to Campfire server
campfire.send("RAccountsAddNotificationsToken", {"token": ntoken.fcm})

# Listening for notifications
def notifi(n):
    print(notifi)
campfire.nlisten(ntoken, notifi)
```
