Is it possible to import and entire collection into Numista?

Pubblicazioni di 5 • visto 483 volte

Is it possible to import and entire collection into Numista? I have a large collection of banknotes in Colnect and I would like to know if there is a way to import them into Numista from an Excel Spreadsheet or CSV file?

gregazar

Is it possible to import and entire collection into Numista? I have a large collection of banknotes in Colnect and I would like to know if there is a way to import them into Numista from an Excel Spreadsheet or CSV file?

There is not.

My guess is that will never be possible for many reasons:

 

 - No site will allow to export all their information to a possible concurrent site;

 - Too many variants, comments, types, subtypes, issuer, years, even some sites treat exonumia as coins;

 - Missing coins or with different names on each site;

 - All coins sites are different, their database are too divergent .

 

Would be like to have a company and allow to export the list of customers to other companies.

It should be possible to achieve part of the result with Numista's API, if you know how to use it.

 

As for the claim that it is impossible to automate the import operation – it should be possible for some items, and for the rest of them the user could be encouraged to enter them manually. For example, one can imagine that the user presents the file in the following format (with four data columns):

 

France 10 centimes 1970

Germany 10 euro cent 2002

Yugoslavia 10 para 1965

 

In the first and the third case it is possible to guess the intended coin unequivocally, but in the second case it is not (because the mint mark is unspecified and it can be a proof or “sets only” coin). So the wizard script could add two coins to the collection and present the warning that one coin remains which should be entered manually. 

Similarly for banknotes.

ūūūūū

Yes Numinis, you are correct. After some brief research, I see I should have asked the question differently. I should have asked if an import script was already available. Colnect and Numista both already allow exporting of a collection to xlsx or csv. I am going to convert my xlsx to an xml file and write a python script to do the import via the API calls.

 

Thank you for tipping me off to the API..

 

Export engine:

 

 

API call examples:

 

 

Some of the exisiting Python code:

 

import requests
from uuid import uuid4

# Parameters
endpoint = 'https://api.numista.com/api/v3'
api_key = 'YOUR API KEY'
client_id = 'YOUR CLIENT ID'

###############################################################################

# API call to search types
search_query = 'Kopecks Siberia'
response = requests.get(
 endpoint + '/types',
 params={'q': search_query, 'page': 1, 'count': 50, 'lang': 'en'},
 headers={'Numista-API-Key': api_key})
search_results = response.json()

# Display search results
print('== Search results for the query "', search_query, '" ==')
print(search_results['count'], 'results found')
for coin in search_results['types']:
 print(coin['title'], 'from', coin['issuer']['name'])
print()

###############################################################################

# API call to get details about a type
coin_type_id = '17970'
response = requests.get(
 endpoint + '/types/' + coin_type_id,
 params={'lang':'en'},
 headers={'Numista-API-Key': api_key})
coin_details = response.json()

# Display some details about the coin
print('== Details about the type #', coin_type_id, '==')
print('URL:', coin_details['url'])
print('Title:', coin_details['title'])
print('Issuer:', coin_details['issuer']['name'])
print('Years:', coin_details['min_year'], '-', coin_details['max_year'])
print('Composition:', coin_details['composition']['text'])
print()

###############################################################################

# API call to get the years when the type was issued
response = requests.get(
 endpoint + '/types/' + coin_type_id + '/issues',
 params={'lang': 'en'},
 headers={'Numista-API-Key': api_key})
years = response.json()

# Display the years
print('== Years ==')
for year in years:
 print(year['year'])
print()

###############################################################################

# API call to get the list of issuers
response = requests.get(
 endpoint + '/issuers',
 params={'lang': 'en'},
 headers={'Numista-API-Key': api_key})
issuers = response.json()

# Display the issuers
print('== Issuers ==')
for i in range(10):
 print(issuers['issuers'][i]['name'])
print('and', issuers['count']-10, 'others...')
print()

###############################################################################

# Authenticate with OAuth2
redirect_uri = 'https://postman-echo.com/get' # Should normally be a URL to your application
state = str(uuid4())
url_template = ('https://{language}.numista.com/api/oauth_authorize.php'
               '?response_type=code'
               '&client_id={client_id}'
               '&redirect_uri={redirect_uri}'
               '&scope={scope}&state={state}')
authorization_url = url_template.format(
 language='en',
 client_id=client_id,
 redirect_uri=redirect_uri,
 scope='view_collection,edit_collection',
 state=state)

print('== Authentication ==')
print('Please open the following URL, authenticate yourself '
     'and provide the data present in the redirection.')
print('Authorization URL:', authorization_url)
authorization_code = input('Code? ')
returned_state = input('State? ')

# Prevent CSFR attacks
if state == returned_state: print ('State is correct.');
else: print('Incorrect state. You should stop the process here.')

# Retrieve access token
response = requests.get(
 endpoint + '/oauth_token',
 params={
   'code': authorization_code,
   'client_id': client_id,
   'client_secret': api_key,
   'redirect_uri': redirect_uri})
authentication_data = response.json()
access_token = authentication_data['access_token']
expires_in = authentication_data['expires_in'] / 3600 / 24
user_id = authentication_data['user_id']
print('The user #', user_id, 'is authenticated for', expires_in, 'days.')
print()

###############################################################################

# API call to get information about a user
response = requests.get(
 endpoint + '/users/' + str(user_id),
 params={'lang': 'en'},
 headers={'Numista-API-Key': api_key})
user_details = response.json()

# Display the issuers
print('== User #', user_id, ' ==')
print('Username:', user_details['username'])
print('Avatar:', user_details['avatar'])
print()

###############################################################################

# API call to get the coins in collection
response = requests.get(
 endpoint + '/users/' + str(user_id) + '/collected_coins',
 params={'lang': 'en'},
 headers={'Numista-API-Key': api_key, 'Authorization': 'Bearer '+access_token})
collection = response.json()

# Display a coin from the collection
print('== Collection ==')
print('The user owns', collection['coin_count'], 'coins.')
print('One of them is:')
coin = collection['collected_coins'][0]
print('Coin:', coin['coin']['title'])
print('Year:', coin['issue']['year'])
print('For swap:', coin['for_swap'])
print()

» Politica del Forum

Il fuso orario utilizzato è UTC+2:00.
L'ora attuale è 10:58.