Search…
⌃K
🔢

Data Manipulation

Now we're going to access an API, and manipulate the outputted json. Then we will organise our code so that we, and others, can navigate it easily.
This two-part course will take you on quite a journey: Start with the modules on this page, and the fundamentals of data transformation using CRANQ. We will then progress to wrapping your code in a REST API, so that you, and others, can access your application from the web.

Lesson 1: Mapping

The first lesson in the Data Manipulation introduces mapping - the most frequent dataflow alternative to loops through determining the USD exchange rates of each currency in a crypto wallet.
Lesson 1

Lesson 2: Building and Joining Dictionaries

Though not strictly fundamental transformations, these ways of merging lists are very common. In the provided example they’re used for replacing the keys of a dictionary.
Lesson 2

Lesson 3: Mapping with External Data

This lesson takes you deeper into the realm of mapping, where items of the result depend on more than just the original items. Without it, it would be difficult to convert each currency to USD, given that rates and amounts are stored in a separate dictionary.
Lesson 3

Lesson 4: Reducing

Summing up numbers? It’s an application of reducing. In this lesson we’ll finally get to know how much USD in total the contents of the example crypto wallet are worth.
Lesson 4

Lesson 5: Filtering

This lesson introduces filtering - removing items from arrays and dictionaries. Some special items need special treatment! For example, converting USDT to USDT.
Lesson 5

Lesson 6: Organising Our Code

Now it's time to name your code, and group it, in a way that it's easy for yourself, or others, to understand and maintain. This final lesson in the Data Manipulation series shows off one of CRANQ's best features, the ability to create comprehensible code
Lesson 6