Skip to main content

ATOM API | R11

Project description

🇬🇧 English | 🇷🇺 Русский | 🇷🇴 Română

atomfoxapi

A small Python API of ATOM Mobility.

Installation

Install python >= 3.9 version and install atomfoxapi with pip:

pip install atomfoxapi

For Mac/Linux you may need to create a virtual environment (venv):

python3 -m venv .venv
source .venv/bin/activate

How to use

How to get all vehicles:

import atomfoxapi

atom = atomfoxapi.Atom('Basic ZX...') # Authorization token

vehicles = atom.get_vehicles(load_all=True) # load all vehicles (or load_all=False for load 100 vehicles)

for vehicle in vehicles:
    print(f'{vehicle.vehicle_number} - {vehicle.vehicle_battery}%')

# this script will show the charge of all vehicles
# example output:
# F0001 - 51%
# F0002 - 79%...

How to set status to vehicle:

import atomfoxapi

atom = atomfoxapi.Atom('Basic ZX...') # Authorization token

vehicles = atom.get_vehicles(search='FF0001') # get vehicle with num FF0001 (return List[])
vehicle = vehicles[0]

response = atom.set_status('TRANSPORTATION', vehicle.id)
if response:
    print(f'Status for vehicle {vehicle.vehicle_number} successfully changed!')
else:
    print('An error occurred.')

# this script changes the status on vehicle FF0001
# example output:
# Status for vehicle FF0001 successfully changed!

How to send command to vehicle

import atomfoxapi

atom = atomfoxapi.Atom('Basic ZX...') # Authorization token

vehicles = atom.get_vehicles(search='FF0001') # get vehicle with num FF0001 | return List[]
vehicle = vehicles[0]

response = atom.send_command('UNLOCK', vehicle.id)
if response:
    print(f'Command successfully sent to {vehicle.vehicle_number}!')
else:
    print(f'An error occurred.')

# this script sends a command to vehicle FF0001
# example output:
# Command successfully sent to FF0001!

How to create task in vehicle

import atomfoxapi

atom = atomfoxapi.Atom('Basic ZX...') # Authorization token

vehicles = atom.get_vehicles(search='FF0001') # get vehicle with num FF0001 | return List[]
vehicle = vehicles[0]

response = atom.set_task('vehicle is damaged', 'HIGH', 'vehicle not working', vehicle.id)
if response:
    print(f'Task successfully created in {vehicle.vehicle_number}!')
else:
    print(f'An error occurred.')

# this script creates a task on the vehicle FF0001
# example output:
# Task successfully created in FF0001!

How to get alerts

import atomfoxapi

atom = atomfoxapi.Atom('Basic ZX...') # Authorization token

alerts = atom.get_alerts('LAST_1_DAY') # get alerts for last 1 day | return List[]

for alert in alerts:
    print(f'{alert.vehicle_nr} - {alert.alert_type} | {alert.timestamp}')

# this gets alerts for the last day
# example output:
# F0001 - NEED_REBALANCING | 17.04.2025 15:28:47
# F0002 - OVERTURNED | 17.04.2025 15:04:43

How to get statistics

import atomfoxapi

atom = atomfoxapi.Atom('Basic ZX...') # Authorization token

stats = atom.get_statistics()
print(f'Avaliable: {stats.available_vehicles}\nIn use: {stats.in_use_vehicles}\n',
      f'Total: {stats.total_vehicles}\n Maintenance: {stats.in_service_vehicles}\n')

# this sctipt get statistics of vehicles
# example output:
# Avaliable: 444
# In use: 19
# Total: 490
# Maintenance: 30

How to get Employee activity log

import main as atomfoxapi

atom = atomfoxapi.Atom('Basic ZX...') # Authorization token

logs = atom.get_employee_activity_log()

for log in logs:
    print(f'{log.admin_email} - {log.vehicle_nr} | {log.status_from}{log.status_to}')

# this sctipt get employee activity log of atom
# example output:
# office@foxscooters.md - FF0001 | Maintenance → Available
# office@foxscooters.md - FF0001 | Available → Transportation

Authors

License

MIT

Moldavskie Technologies | 17.04.2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atomfoxapi-1.2.9.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atomfoxapi-1.2.9-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file atomfoxapi-1.2.9.tar.gz.

File metadata

  • Download URL: atomfoxapi-1.2.9.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for atomfoxapi-1.2.9.tar.gz
Algorithm Hash digest
SHA256 5544596f01b5b03c3d2af0f4e9dc4af711322aa8dd0acb85fb17f0bbd163048a
MD5 9782acae994a0e1d3052fcb4f7ef4650
BLAKE2b-256 a61674b00f4a506794252b0d21ff5bfba17aacabb8b4d96b999b6daba4689f44

See more details on using hashes here.

File details

Details for the file atomfoxapi-1.2.9-py3-none-any.whl.

File metadata

  • Download URL: atomfoxapi-1.2.9-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for atomfoxapi-1.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d545f8b8f68fe37eb90ad10cb1365ef1d0f0fd55954e0da231df735a1f1cac17
MD5 c61da696ea99943de80830eb8595567c
BLAKE2b-256 f7f3aa56977107b349b82494a3bf27f93c25584b6cb12db77660b82a8075e1f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page