Skip to main content

NyarukaSMS

NyarumaSMS aims to provide a quick start for a basic python based SMS app using the tools Nyaruka uses to build its systems. This includes setting up rapidsms, rapidsms-httprouter, smartmin and our parsing and localization libraries.

Getting Started

To get started, follow these steps:

% virtualenv env
% source env/bin/activate
% pip install nsms
% start-nsms [project-name]
% pip install -r pip-requires.txt
% cd [project-name]
% python manage.py syncdb
% python manage.py migrate
% python manage.py runserver

Sample Application

NSMS comes with a simple SMS application to track the mileage on vehicles. The SMS format for the application is as follows.

Registering Cars

Each user of the system much register the car they are using, they do so by sending:

car [license plate]

This register a car to the phone. From now on all mileage reports will be associated with the car with the passed in license plate. The license plate must be 8 characters.

Adding Mileage Reports

Once a user has registered their car, they can report mileage by sending the message:

miles [mileage (integer)]

This records a new mileage report for the car associated with this connection. If the connetion has not registered a car then this will be an error.

Best Practices

This application aims to demonstrate the following best practices:

  • Comprehensive unit coverage. We aim for 100% unit test coverage of our apps, and so should you. This app shows you how easily that can be done

  • DRY. We use Smartmin to allow us to add a lot of functionality without adding much code

  • Language Templates. We let our customers edit the translations for all our messages through a web UI, including using standard Django templates for formatting.

  • Tolerant Parsing. Though still a work in progress, our rapidsms_parser module provides an easy way to programmatically parse SMS messages and give good error messaging in the process.

  • User Management. We provide our customers with basic user management, using groups and SmartMin permissions to easily manage these.

Metadata

Release files for nsms 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nsms 1.0.4
File Size Uploaded
nsms-1.0.4.tar.gz 17.2 kB Details

Release files / nsms-1.0.4.tar.gz

Download URL nsms-1.0.4.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c8b8f5162a8bd12c9a591975897c66faf9d750aec8012429b267831a0069f2
BLAKE2b-256 checksum
How to use checksums
634b8c138029cd73ff3449d9c562d1d3f4b195bb464544e5f25d05b6bb9fd9fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page