webfaction_api 1.0.0

  • README.md
  • Installing
  • Versions
  • 46

Build Status


A dart client for webfaction's RPC API.

Official reference: https://docs.webfaction.com/xmlrpc-api/

Webfaction info: https://www.webfaction.com/?aid=50399 (affiliate link)


  1. pubspec.yaml:
  sdk: '>=2.0.0-dev.65.0 <3.0.0'

  webfaction_api: '>=1.0.0'
  1. pub get


~/dart-webfaction-api/ $ dartdoc
~/dart-webfaction-api/ $ dhttpd --path doc/api


import 'package:webfaction_api/client.dart';
import 'package:webfaction_api/response.dart';

main() async {
  var client = new Client('username', 'password', 'SomeServer543');
  await client.login();

  // or

  client.login().then((response) async {
    List<Map> rawResponse = await client.app.list();

    // Response objects imported from `response.dart`
    List<App> appListManuallyCreated = await client.app.list()
        .then((response) => response.map((data) => new App.fromMap(data)));

    App newApp = await client.app
        .create('MyNewApp', 'django-2.0.5_mod_wsgi-4.6.4_python-3.6')
        .then((response) => new App.fromMap(response));

    // Or pass objects around
    App app = new App('MyNewApp', 'django-2.0.5_mod_wsgi-4.6.4_python-3.6');
        .then((_) => client.app.deleteFromInstance(app));

Usage Summary

  1. Import client.dart for the client and API classes. Import response.dart to use the response objects and related helper function
import 'package:webfaction_api/client.dart';
import 'package:webfaction_api/response.dart';
  1. Instantiate a client with your webfaction username, password, and server name
var client = new Client('username', 'password, 'Server153');
  1. Login. The session ID is stored in the client so there is no need to pass it to subsequent calls. According to webfaction, the session ID remains valid for one hour
  1. Call api methods.

Method location

The webfaction API is large and flat. In order to tidy things up and make code completion more helpful, the methods were grouped and scoped to class properties corresponding to the section or subsection they appear under on the API reference page.

For example, methods under Applications are found on client.app.<method>

A couple slight deviations from this convention are as follows:

  • Databases: client.db
  • Email -> Addresses: client.email
  • Email -> Mailboxes: client.mailbox
  • Miscellaneous: client.misc
  • General -> Login: client.login(...)

Method naming

The method names use camel case instead of snake case, as per dart style recommendations, and the 'section' is removed from the name:

create_db becomes client.db.create

create_db_user becomes client.db.createUser

API response objects

A collection of dumb objects have been provided that represent API input or output.

Most methods have a corresponding <methodName>FromInstance or FromInstances method that can be called with objects instead of manually passing individual parameters.

Objects intended to be used with API methods that return data have a .fromMap factory constructor that can be used to instanciate directly with the response data.



  • RPC adapter class replaces RPC function call
  • Instantiates APIs on construction rather than when session changes
  • APIs made final


  • Bugfix: Unfixed bugfix :)


  • Bugfix: Incorrect parameter order for App object instantiation from hashmap


  • Dart 2.0 support


  • Bugfix: API's were not being set properly


  • Removed createList helper


  • Isolated createList to its own package to allow compatibility with flutter


  • Complete API support
  • Response objects include to use with the API

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  webfaction_api: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:webfaction_api/adapter.dart';
import 'package:webfaction_api/client.dart';
import 'package:webfaction_api/response.dart';
Version Uploaded Documentation Archive
1.0.0 Aug 4, 2018 Go to the documentation of webfaction_api 1.0.0 Download webfaction_api 1.0.0 archive
0.9.2 Aug 4, 2018 Go to the documentation of webfaction_api 0.9.2 Download webfaction_api 0.9.2 archive
0.9.1 Aug 3, 2018 Go to the documentation of webfaction_api 0.9.1 Download webfaction_api 0.9.1 archive
0.9.0 Jul 21, 2018 Go to the documentation of webfaction_api 0.9.0 Download webfaction_api 0.9.0 archive
0.8.3 Jun 10, 2018 Go to the documentation of webfaction_api 0.8.3 Download webfaction_api 0.8.3 archive
0.8.2 Jun 10, 2018 Go to the documentation of webfaction_api 0.8.2 Download webfaction_api 0.8.2 archive
0.8.1 Jun 10, 2018 Go to the documentation of webfaction_api 0.8.1 Download webfaction_api 0.8.1 archive
0.8.0 May 13, 2018 Go to the documentation of webfaction_api 0.8.0 Download webfaction_api 0.8.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use webfaction_api.dart. Packages with multiple examples should use example/readme.md.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.65.0 <3.0.0
xml_rpc ^0.2.2 0.2.2
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http 0.11.3+17 0.12.0
http_parser 3.1.3
meta 1.1.6
path 1.6.2
petitparser 2.0.2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
xml 3.2.3
Dev dependencies
test >=0.12.0